public class ValidatingRecordConsumer extends RecordConsumer
| Constructor and Description |
|---|
ValidatingRecordConsumer(RecordConsumer delegate,
MessageType schema) |
| Modifier and Type | Method and Description |
|---|---|
void |
addBinary(Binary value)
add a binary value in the current field
|
void |
addBoolean(boolean value)
add a boolean value in the current field
|
void |
addDouble(double value)
add a double value in the current field
|
void |
addFloat(float value)
add a float value in the current field
|
void |
addInteger(int value)
add an int value in the current field
|
void |
addLong(long value)
add a long value in the current field
|
void |
endField(String field,
int index)
end of a field in a group or message
|
void |
endGroup()
end of a group in a field
|
void |
endMessage()
end of a record
|
void |
flush()
NoOps by default
Subclass class can implement its own flushing logic
|
void |
startField(String field,
int index)
start of a field in a group or message
if the field is repeated the field is started only once and all values added in between start and end
|
void |
startGroup()
start of a group in a field
|
void |
startMessage()
start a new record
|
public ValidatingRecordConsumer(RecordConsumer delegate, MessageType schema)
delegate - the consumer to pass down the event toschema - the schema to validate againstpublic void startMessage()
startMessage in class RecordConsumerpublic void endMessage()
endMessage in class RecordConsumerpublic void startField(String field, int index)
startField in class RecordConsumerfield - name of the fieldindex - of the field in the group or messagepublic void endField(String field, int index)
endField in class RecordConsumerfield - name of the fieldindex - of the field in the group or messagepublic void startGroup()
startGroup in class RecordConsumerpublic void endGroup()
endGroup in class RecordConsumerpublic void flush()
flush in class RecordConsumerpublic void addInteger(int value)
addInteger in class RecordConsumervalue - an int valuepublic void addLong(long value)
addLong in class RecordConsumervalue - a long valuepublic void addBoolean(boolean value)
addBoolean in class RecordConsumervalue - a boolean valuepublic void addBinary(Binary value)
addBinary in class RecordConsumervalue - a binary valuepublic void addFloat(float value)
addFloat in class RecordConsumervalue - a float valuepublic void addDouble(double value)
addDouble in class RecordConsumervalue - a double valueCopyright © 2019 The Apache Software Foundation. All rights reserved.