Class: Types::Constant_definition::ConstantValueDefinition

Inherits:
Thrift::Union
  • Object
show all
Includes:
Thrift::Struct_Union
Defined in:
lib/types/constant_definition/constant_definition_types.rb,
lib/types/constant_definition/constant_definition_types.rb

Constant Summary collapse

NAME =
'ConstantValueDefinition'.freeze
NAMESPACE =
'types.constant_definition'.freeze
LEGACY_ANNOTATIONS =
{
}.freeze
STRUCTURED_ANNOTATIONS =
[
].freeze
THRIFT_FIELD_INDEX_REFERENCE =
1
THRIFT_FIELD_INDEX_INTEGER_VALUE =
2
THRIFT_FIELD_INDEX_DOUBLE_VALUE =
3
THRIFT_FIELD_INDEX_BOOL_VALUE =
4
THRIFT_FIELD_INDEX_STRING_VALUE =
5
THRIFT_FIELD_INDEX_LIST_VALUE =
6
THRIFT_FIELD_INDEX_MAP_VALUE =
7
THRIFT_FIELD_REFERENCE_LEGACY_ANNOTATIONS =
{
}.freeze
THRIFT_FIELD_REFERENCE_STRUCTURED_ANNOTATIONS =
[
].freeze
THRIFT_FIELD_INTEGER_VALUE_LEGACY_ANNOTATIONS =
{
}.freeze
THRIFT_FIELD_INTEGER_VALUE_STRUCTURED_ANNOTATIONS =
[
].freeze
THRIFT_FIELD_DOUBLE_VALUE_LEGACY_ANNOTATIONS =
{
}.freeze
THRIFT_FIELD_DOUBLE_VALUE_STRUCTURED_ANNOTATIONS =
[
].freeze
THRIFT_FIELD_BOOL_VALUE_LEGACY_ANNOTATIONS =
{
}.freeze
THRIFT_FIELD_BOOL_VALUE_STRUCTURED_ANNOTATIONS =
[
].freeze
THRIFT_FIELD_STRING_VALUE_LEGACY_ANNOTATIONS =
{
}.freeze
THRIFT_FIELD_STRING_VALUE_STRUCTURED_ANNOTATIONS =
[
].freeze
THRIFT_FIELD_LIST_VALUE_LEGACY_ANNOTATIONS =
{
}.freeze
THRIFT_FIELD_LIST_VALUE_STRUCTURED_ANNOTATIONS =
[
].freeze
THRIFT_FIELD_MAP_VALUE_LEGACY_ANNOTATIONS =
{
}.freeze
THRIFT_FIELD_MAP_VALUE_STRUCTURED_ANNOTATIONS =
[
].freeze
FIELDS =
{
  THRIFT_FIELD_INDEX_REFERENCE => {type: ::Thrift::Types::STRUCT, name: 'reference', class: ::Thrift::Types::Core::Reference, optional: true, legacy_annotations: THRIFT_FIELD_REFERENCE_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_REFERENCE_STRUCTURED_ANNOTATIONS},
  THRIFT_FIELD_INDEX_INTEGER_VALUE => {type: ::Thrift::Types::I64, name: 'integer_value', optional: true, legacy_annotations: THRIFT_FIELD_INTEGER_VALUE_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_INTEGER_VALUE_STRUCTURED_ANNOTATIONS},
  THRIFT_FIELD_INDEX_DOUBLE_VALUE => {type: ::Thrift::Types::DOUBLE, name: 'double_value', optional: true, legacy_annotations: THRIFT_FIELD_DOUBLE_VALUE_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_DOUBLE_VALUE_STRUCTURED_ANNOTATIONS},
  THRIFT_FIELD_INDEX_BOOL_VALUE => {type: ::Thrift::Types::BOOL, name: 'bool_value', optional: true, legacy_annotations: THRIFT_FIELD_BOOL_VALUE_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_BOOL_VALUE_STRUCTURED_ANNOTATIONS},
  THRIFT_FIELD_INDEX_STRING_VALUE => {type: ::Thrift::Types::STRING, name: 'string_value', optional: true, legacy_annotations: THRIFT_FIELD_STRING_VALUE_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_STRING_VALUE_STRUCTURED_ANNOTATIONS},
  THRIFT_FIELD_INDEX_LIST_VALUE => {type: ::Thrift::Types::STRUCT, name: 'list_value', class: ::Types::Constant_definition::ListConstantValueDefinition, optional: true, legacy_annotations: THRIFT_FIELD_LIST_VALUE_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_LIST_VALUE_STRUCTURED_ANNOTATIONS},
  THRIFT_FIELD_INDEX_MAP_VALUE => {type: ::Thrift::Types::STRUCT, name: 'map_value', class: ::Types::Constant_definition::MapConstantValueDefinition, optional: true, legacy_annotations: THRIFT_FIELD_MAP_VALUE_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_MAP_VALUE_STRUCTURED_ANNOTATIONS}
}.freeze

Constants included from Thrift::Struct_Union

Thrift::Struct_Union::CONTAINER_TYPES

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Thrift::Struct_Union

#each_field, #field_info, #inspect_collection, #inspect_field, #is_container?, #name_to_id, #read_field, #sorted_field_ids, #write_container, #write_data

Methods inherited from Thrift::Union

#<=>, #==, field_accessor, generate_accessors, #get_set_field, #get_value, #hash, #initialize, #inspect, qmark_isset_method, #read, #write

Constructor Details

This class inherits a constructor from Thrift::Union

Class Method Details

.bool_value(val) ⇒ Object



160
161
162
# File 'lib/types/constant_definition/constant_definition_types.rb', line 160

def bool_value(val)
  ConstantValueDefinition.new(:bool_value, val)
end

.double_value(val) ⇒ Object



156
157
158
# File 'lib/types/constant_definition/constant_definition_types.rb', line 156

def double_value(val)
  ConstantValueDefinition.new(:double_value, val)
end

.integer_value(val) ⇒ Object



152
153
154
# File 'lib/types/constant_definition/constant_definition_types.rb', line 152

def integer_value(val)
  ConstantValueDefinition.new(:integer_value, val)
end

.list_value(val) ⇒ Object



168
169
170
# File 'lib/types/constant_definition/constant_definition_types.rb', line 168

def list_value(val)
  ConstantValueDefinition.new(:list_value, val)
end

.map_value(val) ⇒ Object



172
173
174
# File 'lib/types/constant_definition/constant_definition_types.rb', line 172

def map_value(val)
  ConstantValueDefinition.new(:map_value, val)
end

.reference(val) ⇒ Object



148
149
150
# File 'lib/types/constant_definition/constant_definition_types.rb', line 148

def reference(val)
  ConstantValueDefinition.new(:reference, val)
end

.string_value(val) ⇒ Object



164
165
166
# File 'lib/types/constant_definition/constant_definition_types.rb', line 164

def string_value(val)
  ConstantValueDefinition.new(:string_value, val)
end

Instance Method Details

#struct_fieldsObject



237
# File 'lib/types/constant_definition/constant_definition_types.rb', line 237

def struct_fields; FIELDS; end

#validateObject

Raises:

  • (StandardError)


239
240
241
# File 'lib/types/constant_definition/constant_definition_types.rb', line 239

def validate
  raise(StandardError, 'Union fields are not set.') if get_set_field.nil? || get_value.nil?
end