Class: Hive2::Thrift::TTypeEntry

Inherits:
Thrift::Union
  • Object
show all
Includes:
Thrift::Struct_Union
Defined in:
lib/thrift/t_c_l_i_service_types.rb

Constant Summary collapse

PRIMITIVEENTRY =
1
ARRAYENTRY =
2
MAPENTRY =
3
STRUCTENTRY =
4
UNIONENTRY =
5
USERDEFINEDTYPEENTRY =
6
FIELDS =
{
  PRIMITIVEENTRY => {:type => ::Thrift::Types::STRUCT, :name => 'primitiveEntry', :class => ::Hive2::Thrift::TPrimitiveTypeEntry},
  ARRAYENTRY => {:type => ::Thrift::Types::STRUCT, :name => 'arrayEntry', :class => ::Hive2::Thrift::TArrayTypeEntry},
  MAPENTRY => {:type => ::Thrift::Types::STRUCT, :name => 'mapEntry', :class => ::Hive2::Thrift::TMapTypeEntry},
  STRUCTENTRY => {:type => ::Thrift::Types::STRUCT, :name => 'structEntry', :class => ::Hive2::Thrift::TStructTypeEntry},
  UNIONENTRY => {:type => ::Thrift::Types::STRUCT, :name => 'unionEntry', :class => ::Hive2::Thrift::TUnionTypeEntry},
  USERDEFINEDTYPEENTRY => {:type => ::Thrift::Types::STRUCT, :name => 'userDefinedTypeEntry', :class => ::Hive2::Thrift::TUserDefinedTypeEntry}
}

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.arrayEntry(val) ⇒ Object


311
312
313
# File 'lib/thrift/t_c_l_i_service_types.rb', line 311

def arrayEntry(val)
  TTypeEntry.new(:arrayEntry, val)
end

.mapEntry(val) ⇒ Object


315
316
317
# File 'lib/thrift/t_c_l_i_service_types.rb', line 315

def mapEntry(val)
  TTypeEntry.new(:mapEntry, val)
end

.primitiveEntry(val) ⇒ Object


307
308
309
# File 'lib/thrift/t_c_l_i_service_types.rb', line 307

def primitiveEntry(val)
  TTypeEntry.new(:primitiveEntry, val)
end

.structEntry(val) ⇒ Object


319
320
321
# File 'lib/thrift/t_c_l_i_service_types.rb', line 319

def structEntry(val)
  TTypeEntry.new(:structEntry, val)
end

.unionEntry(val) ⇒ Object


323
324
325
# File 'lib/thrift/t_c_l_i_service_types.rb', line 323

def unionEntry(val)
  TTypeEntry.new(:unionEntry, val)
end

.userDefinedTypeEntry(val) ⇒ Object


327
328
329
# File 'lib/thrift/t_c_l_i_service_types.rb', line 327

def userDefinedTypeEntry(val)
  TTypeEntry.new(:userDefinedTypeEntry, val)
end

Instance Method Details

#struct_fieldsObject


348
# File 'lib/thrift/t_c_l_i_service_types.rb', line 348

def struct_fields; FIELDS; end

#validateObject

Raises:

  • (StandardError)

350
351
352
# File 'lib/thrift/t_c_l_i_service_types.rb', line 350

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