|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.kafka.common.protocol.types.Type org.apache.kafka.common.protocol.types.Schema
public class Schema
The schema for a compound record definition
Field Summary |
---|
Fields inherited from class org.apache.kafka.common.protocol.types.Type |
---|
BYTES, INT16, INT32, INT64, INT8, STRING |
Constructor Summary | |
---|---|
Schema(Field... fs)
|
Method Summary | |
---|---|
Field[] |
fields()
Get all the fields in this schema |
Field |
get(int slot)
Get a field by its slot in the record array |
Field |
get(java.lang.String name)
Get a field by its name |
int |
numFields()
The number of fields in this schema |
java.lang.Object |
read(java.nio.ByteBuffer buffer)
Read a struct from the buffer |
int |
sizeOf(java.lang.Object o)
The size of the given record |
java.lang.String |
toString()
Display a string representation of the schema |
Struct |
validate(java.lang.Object item)
|
void |
write(java.nio.ByteBuffer buffer,
java.lang.Object o)
Write a struct to the buffer |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Schema(Field... fs)
Method Detail |
---|
public void write(java.nio.ByteBuffer buffer, java.lang.Object o)
write
in class Type
public java.lang.Object read(java.nio.ByteBuffer buffer)
read
in class Type
public int sizeOf(java.lang.Object o)
sizeOf
in class Type
public int numFields()
public Field get(int slot)
slot
- The slot at which this field sits
public Field get(java.lang.String name)
name
- The name of the field
public Field[] fields()
public java.lang.String toString()
toString
in class java.lang.Object
public Struct validate(java.lang.Object item)
validate
in class Type
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |