Class: Types::Struct_definition::FieldDefinition
- Inherits:
-
Object
- Object
- Types::Struct_definition::FieldDefinition
- Includes:
- Thrift::Struct, Thrift::Struct_Union
- Defined in:
- lib/types/struct_definition/struct_definition_types.rb,
lib/types/struct_definition/struct_definition_types.rb
Constant Summary collapse
- NAME =
'FieldDefinition'.freeze
- NAMESPACE =
'types.struct_definition'.freeze
- LEGACY_ANNOTATIONS =
{ }.freeze
- STRUCTURED_ANNOTATIONS =
[ ].freeze
- THRIFT_FIELD_INDEX_ANNOTATION =
1- THRIFT_FIELD_INDEX_ID =
2- THRIFT_FIELD_INDEX_TYPE =
3- THRIFT_FIELD_INDEX_REQUIREDNESS =
4- THRIFT_FIELD_ANNOTATION_LEGACY_ANNOTATIONS =
{ }.freeze
- THRIFT_FIELD_ANNOTATION_STRUCTURED_ANNOTATIONS =
[ ].freeze
- THRIFT_FIELD_ID_LEGACY_ANNOTATIONS =
{ }.freeze
- THRIFT_FIELD_ID_STRUCTURED_ANNOTATIONS =
[ ].freeze
- THRIFT_FIELD_TYPE_LEGACY_ANNOTATIONS =
{ }.freeze
- THRIFT_FIELD_TYPE_STRUCTURED_ANNOTATIONS =
[ ].freeze
- THRIFT_FIELD_REQUIREDNESS_LEGACY_ANNOTATIONS =
{ }.freeze
- THRIFT_FIELD_REQUIREDNESS_STRUCTURED_ANNOTATIONS =
[ ].freeze
- FIELDS =
{ THRIFT_FIELD_INDEX_ANNOTATION => {type: ::Thrift::Types::STRUCT, name: 'annotation', class: ::Types::Annotation_definition::AnnotationDefinition, legacy_annotations: THRIFT_FIELD_ANNOTATION_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_ANNOTATION_STRUCTURED_ANNOTATIONS}, THRIFT_FIELD_INDEX_ID => {type: ::Thrift::Types::I32, name: 'id', legacy_annotations: THRIFT_FIELD_ID_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_ID_STRUCTURED_ANNOTATIONS}, THRIFT_FIELD_INDEX_TYPE => {type: ::Thrift::Types::STRUCT, name: 'type', class: ::Types::Type_definition::TypeDefinition, legacy_annotations: THRIFT_FIELD_TYPE_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_TYPE_STRUCTURED_ANNOTATIONS}, THRIFT_FIELD_INDEX_REQUIREDNESS => {type: ::Thrift::Types::I32, name: 'requiredness', enum_class: ::Types::Struct_definition::Requiredness, legacy_annotations: THRIFT_FIELD_REQUIREDNESS_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_REQUIREDNESS_STRUCTURED_ANNOTATIONS} }.freeze
Constants included from Thrift::Struct_Union
Thrift::Struct_Union::CONTAINER_TYPES
Instance Method Summary collapse
Methods included from Thrift::Struct
#<=>, #==, append_features, #differences, #eql?, field_accessor, #fields_with_default_values, generate_accessors, #hash, #initialize, #inspect, qmark_isset_method, #read, #write
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
Instance Method Details
#struct_fields ⇒ Object
83 |
# File 'lib/types/struct_definition/struct_definition_types.rb', line 83 def struct_fields; FIELDS; end |
#validate ⇒ Object
85 86 87 88 89 90 91 92 93 |
# File 'lib/types/struct_definition/struct_definition_types.rb', line 85 def validate raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field annotation is unset!') unless @annotation raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field id is unset!') unless @id raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field type is unset!') unless @type raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field requiredness is unset!') unless @requiredness unless @requiredness.nil? || ::Types::Struct_definition::Requiredness::VALID_VALUES.include?(@requiredness) raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field requiredness!') end end |