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()
Recordpublic Object get(String name)
Recordpublic ByteBuffer getBytes(int index)
RecordByteBuffer.
If the field is not of the correct type an exception will be thrown.public ByteBuffer getBytes(String name)
RecordByteBuffer.
If the field is not of the correct type an exception will be thrown.public Double getDouble(int index)
RecordDouble.
If the field is not of the correct type an exception will be thrown.public Double getDouble(String name)
RecordDouble.
If the field is not of the correct type an exception will be thrown.public Float getFloat(int index)
RecordFloat.
If the field is not of the correct type an exception will be thrown.public Float getFloat(String name)
RecordFloat.
If the field is not of the correct type an exception will be thrown.public Integer getInt(int index)
RecordInteger.
If the field is not of the correct type an exception will be thrown.public Integer getInt(String name)
RecordInteger.
If the field is not of the correct type an exception will be thrown.public Long getLong(int index)
RecordLong.
If the field is not of the correct type an exception will be thrown.public Long getLong(String name)
RecordLong.
If the field is not of the correct type an exception will be thrown.public String getString(int index)
RecordString.
If the field is not of the correct type an exception will be thrown.public String getString(String name)
RecordString.
If the field is not of the correct type an exception will be thrown.public void put(String name, Object value)
Recordpublic Map<String,Object> getDataMap()
RecordMap 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 RecordCopyright © 2019. All rights reserved.