|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.avro.data.RecordBuilderBase<GenericData.Record> org.apache.avro.generic.GenericRecordBuilder
public class GenericRecordBuilder
A RecordBuilder for generic records
Field Summary |
---|
Fields inherited from class org.apache.avro.data.RecordBuilderBase |
---|
data, fields, fieldSetFlags, schema |
Constructor Summary | |
---|---|
GenericRecordBuilder(GenericData.Record other)
Creates a GenericRecordBuilder by copying an existing record instance. |
|
GenericRecordBuilder(GenericRecordBuilder other)
Creates a GenericRecordBuilder by copying an existing GenericRecordBuilder. |
|
GenericRecordBuilder(Schema schema)
Creates a GenericRecordBuilder for building Record instances. |
Method Summary | |
---|---|
GenericData.Record |
build()
Constructs a new instance using the values set in the RecordBuilder. |
protected GenericRecordBuilder |
clear(int pos)
Clears the value of the given field. |
GenericRecordBuilder |
clear(Schema.Field field)
Clears the value of the given field. |
GenericRecordBuilder |
clear(String fieldName)
Clears the value of the given field. |
boolean |
equals(Object obj)
|
protected Object |
get(int pos)
Gets the value of a field. |
Object |
get(Schema.Field field)
Gets the value of a field. |
Object |
get(String fieldName)
Gets the value of a field. |
protected boolean |
has(int pos)
Checks whether a field has been set. |
boolean |
has(Schema.Field field)
Checks whether a field has been set. |
boolean |
has(String fieldName)
Checks whether a field has been set. |
int |
hashCode()
|
protected GenericRecordBuilder |
set(int pos,
Object value)
Sets the value of a field. |
GenericRecordBuilder |
set(Schema.Field field,
Object value)
Sets the value of a field. |
GenericRecordBuilder |
set(String fieldName,
Object value)
Sets the value of a field. |
Methods inherited from class org.apache.avro.data.RecordBuilderBase |
---|
getDefaultValue, isValidValue, validate |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GenericRecordBuilder(Schema schema)
schema
- the schema associated with the record class.public GenericRecordBuilder(GenericRecordBuilder other)
other
- the GenericRecordBuilder to copy.public GenericRecordBuilder(GenericData.Record other)
other
- the record instance to copy.Method Detail |
---|
public Object get(String fieldName)
fieldName
- the name of the field to get.
public Object get(Schema.Field field)
field
- the field to get.
protected Object get(int pos)
pos
- the position of the field to get.
public GenericRecordBuilder set(String fieldName, Object value)
fieldName
- the name of the field to set.value
- the value to set.
public GenericRecordBuilder set(Schema.Field field, Object value)
field
- the field to set.value
- the value to set.
protected GenericRecordBuilder set(int pos, Object value)
field
- the field to set.value
- the value to set.
public boolean has(String fieldName)
fieldName
- the name of the field to check.
public boolean has(Schema.Field field)
field
- the field to check.
protected boolean has(int pos)
pos
- the position of the field to check.
public GenericRecordBuilder clear(String fieldName)
fieldName
- the name of the field to clear.
public GenericRecordBuilder clear(Schema.Field field)
field
- the field to clear.
protected GenericRecordBuilder clear(int pos)
pos
- the position of the field to clear.
public GenericData.Record build()
RecordBuilder
public int hashCode()
hashCode
in class RecordBuilderBase<GenericData.Record>
public boolean equals(Object obj)
equals
in class RecordBuilderBase<GenericData.Record>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |