public class Schema extends Object
Constructor and Description |
---|
Schema(List<String> fields,
List<DataBox> fieldTypes) |
Modifier and Type | Method and Description |
---|---|
Record |
decode(byte[] input)
Takes a byte[] and decodes it into a Record.
|
byte[] |
encode(Record record)
Serializes the provided record into a byte[].
|
boolean |
equals(Object other) |
int |
getEntrySize() |
List<String> |
getFieldNames() |
List<DataBox> |
getFieldTypes() |
Record |
verify(List<DataBox> values)
Verifies that a list of DataBoxes corresponds to this schema.
|
public Record verify(List<DataBox> values) throws SchemaException
values
- the list of values to checkSchemaException
- if the values specified don't conform to this Schemapublic byte[] encode(Record record)
record
- the record to encodepublic Record decode(byte[] input)
input
- the byte array to decodepublic int getEntrySize()
Copyright © 2017. All rights reserved.