public abstract class RecordBase extends Object implements Record
Record
. Derived classes must at a minimum implement the
Record.getType()
, Record.get(int)
, and Record.put(int, Object)
methods.Constructor and Description |
---|
RecordBase() |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
Object |
get(String name)
Returns the value of the specified field.
|
ByteBuffer |
getBytes(int index)
Returns the value of the specified field cast to a
ByteBuffer . |
ByteBuffer |
getBytes(String name)
Returns the value of the specified field cast to a
ByteBuffer . |
Map<String,Object> |
getDataMap()
Returns a
Map of field names to values that is bound to the
record (updates made to the map are reflected in the record and vice
versa). |
Double |
getDouble(int index)
Returns the value of the specified field cast to a
Double . |
Double |
getDouble(String name)
Returns the value of the specified field cast to a
Double . |
Float |
getFloat(int index)
Returns the value of the specified field cast to a
Float . |
Float |
getFloat(String name)
Returns the value of the specified field cast to a
Float . |
Integer |
getInt(int index)
Returns the value of the specified field cast to a
Integer . |
Integer |
getInt(String name)
Returns the value of the specified field cast to a
Integer . |
Long |
getLong(int index)
Returns the value of the specified field cast to a
Long . |
Long |
getLong(String name)
Returns the value of the specified field cast to a
Long . |
org.apache.avro.Schema |
getSchema()
Returns the Avro record schema of the record.
|
String |
getString(int index)
Returns the value of the specified field cast to a
String . |
String |
getString(String name)
Returns the value of the specified field cast to a
String . |
int |
hashCode() |
void |
put(String name,
Object value)
Sets the value of the specified field.
|
String |
toString() |
public org.apache.avro.Schema getSchema()
Record
public Object get(String name)
Record
public ByteBuffer getBytes(int index)
Record
ByteBuffer
.
If the field is not of the correct type an exception will be thrown.public ByteBuffer getBytes(String name)
Record
ByteBuffer
.
If the field is not of the correct type an exception will be thrown.public Double getDouble(int index)
Record
Double
.
If the field is not of the correct type an exception will be thrown.public Double getDouble(String name)
Record
Double
.
If the field is not of the correct type an exception will be thrown.public Float getFloat(int index)
Record
Float
.
If the field is not of the correct type an exception will be thrown.public Float getFloat(String name)
Record
Float
.
If the field is not of the correct type an exception will be thrown.public Integer getInt(int index)
Record
Integer
.
If the field is not of the correct type an exception will be thrown.public Integer getInt(String name)
Record
Integer
.
If the field is not of the correct type an exception will be thrown.public Long getLong(int index)
Record
Long
.
If the field is not of the correct type an exception will be thrown.public Long getLong(String name)
Record
Long
.
If the field is not of the correct type an exception will be thrown.public String getString(int index)
Record
String
.
If the field is not of the correct type an exception will be thrown.public String getString(String name)
Record
String
.
If the field is not of the correct type an exception will be thrown.public void put(String name, Object value)
Record
public Map<String,Object> getDataMap()
Record
Map
of field names to values that is bound to the
record (updates made to the map are reflected in the record and vice
versa).getDataMap
in interface Record
Copyright © 2020. All rights reserved.