Class ValidatingRecordConsumer


  • public class ValidatingRecordConsumer
    extends RecordConsumer
    Wraps a record consumer Validates the record written against the schema and pass down the event to the wrapped consumer
    • Constructor Detail

      • ValidatingRecordConsumer

        public ValidatingRecordConsumer​(RecordConsumer delegate,
                                        MessageType schema)
        Parameters:
        delegate - the consumer to pass down the event to
        schema - the schema to validate against
    • Method Detail

      • startField

        public 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
        Specified by:
        startField in class RecordConsumer
        Parameters:
        field - name of the field
        index - of the field in the group or message
      • endField

        public void endField​(String field,
                             int index)
        end of a field in a group or message
        Specified by:
        endField in class RecordConsumer
        Parameters:
        field - name of the field
        index - of the field in the group or message
      • endGroup

        public void endGroup()
        end of a group in a field
        Specified by:
        endGroup in class RecordConsumer
      • flush

        public void flush()
        NoOps by default Subclass class can implement its own flushing logic
        Overrides:
        flush in class RecordConsumer
      • addInteger

        public void addInteger​(int value)
        add an int value in the current field
        Specified by:
        addInteger in class RecordConsumer
        Parameters:
        value - an int value
      • addLong

        public void addLong​(long value)
        add a long value in the current field
        Specified by:
        addLong in class RecordConsumer
        Parameters:
        value - a long value
      • addBoolean

        public void addBoolean​(boolean value)
        add a boolean value in the current field
        Specified by:
        addBoolean in class RecordConsumer
        Parameters:
        value - a boolean value
      • addBinary

        public void addBinary​(Binary value)
        add a binary value in the current field
        Specified by:
        addBinary in class RecordConsumer
        Parameters:
        value - a binary value
      • addFloat

        public void addFloat​(float value)
        add a float value in the current field
        Specified by:
        addFloat in class RecordConsumer
        Parameters:
        value - a float value
      • addDouble

        public void addDouble​(double value)
        add a double value in the current field
        Specified by:
        addDouble in class RecordConsumer
        Parameters:
        value - a double value