public class User
extends org.apache.avro.specific.SpecificRecordBase
implements org.apache.avro.specific.SpecificRecord
Modifier and Type | Class and Description |
---|---|
static class |
User.Builder
RecordBuilder for User instances.
|
Modifier and Type | Field and Description |
---|---|
static org.apache.avro.Schema |
SCHEMA$ |
Constructor and Description |
---|
User()
Default constructor.
|
User(CharSequence name,
CharSequence favoriteNumber,
CharSequence favoriteColor,
EventType eventType)
All-args constructor.
|
Modifier and Type | Method and Description |
---|---|
static org.apache.avro.message.BinaryMessageDecoder<User> |
createDecoder(org.apache.avro.message.SchemaStore resolver)
Create a new BinaryMessageDecoder instance for this class that uses the specified
SchemaStore . |
void |
customDecode(org.apache.avro.io.ResolvingDecoder in) |
void |
customEncode(org.apache.avro.io.Encoder out) |
static User |
fromByteBuffer(ByteBuffer b)
Deserializes a User from a ByteBuffer.
|
Object |
get(int field$) |
static org.apache.avro.Schema |
getClassSchema() |
static org.apache.avro.message.BinaryMessageDecoder<User> |
getDecoder()
Return the BinaryMessageDecoder instance used by this class.
|
static org.apache.avro.message.BinaryMessageEncoder<User> |
getEncoder()
Return the BinaryMessageEncoder instance used by this class.
|
EventType |
getEventType()
Gets the value of the 'eventType' field.
|
CharSequence |
getFavoriteColor()
Gets the value of the 'favoriteColor' field.
|
CharSequence |
getFavoriteNumber()
Gets the value of the 'favoriteNumber' field.
|
CharSequence |
getName()
Gets the value of the 'name' field.
|
org.apache.avro.Schema |
getSchema() |
org.apache.avro.specific.SpecificData |
getSpecificData() |
protected boolean |
hasCustomCoders() |
static User.Builder |
newBuilder()
Creates a new User RecordBuilder.
|
static User.Builder |
newBuilder(User.Builder other)
Creates a new User RecordBuilder by copying an existing Builder.
|
static User.Builder |
newBuilder(User other)
Creates a new User RecordBuilder by copying an existing User instance.
|
void |
put(int field$,
Object value$) |
void |
readExternal(ObjectInput in) |
void |
setEventType(EventType value)
Sets the value of the 'eventType' field.
|
void |
setFavoriteColor(CharSequence value)
Sets the value of the 'favoriteColor' field.
|
void |
setFavoriteNumber(CharSequence value)
Sets the value of the 'favoriteNumber' field.
|
void |
setName(CharSequence value)
Sets the value of the 'name' field.
|
ByteBuffer |
toByteBuffer()
Serializes this User to a ByteBuffer.
|
void |
writeExternal(ObjectOutput out) |
public User()
newBuilder()
.public User(CharSequence name, CharSequence favoriteNumber, CharSequence favoriteColor, EventType eventType)
name
- The new value for namefavoriteNumber
- The new value for favoriteNumberfavoriteColor
- The new value for favoriteColoreventType
- The new value for eventTypepublic static org.apache.avro.Schema getClassSchema()
public static org.apache.avro.message.BinaryMessageEncoder<User> getEncoder()
public static org.apache.avro.message.BinaryMessageDecoder<User> getDecoder()
public static org.apache.avro.message.BinaryMessageDecoder<User> createDecoder(org.apache.avro.message.SchemaStore resolver)
SchemaStore
.resolver
- a SchemaStore
used to find schemas by fingerprintpublic ByteBuffer toByteBuffer() throws IOException
IOException
- if this instance could not be serializedpublic static User fromByteBuffer(ByteBuffer b) throws IOException
b
- a byte buffer holding serialized data for an instance of this classIOException
- if the given bytes could not be deserialized into an instance of this classpublic org.apache.avro.specific.SpecificData getSpecificData()
public org.apache.avro.Schema getSchema()
getSchema
in interface org.apache.avro.generic.GenericContainer
getSchema
in class org.apache.avro.specific.SpecificRecordBase
public Object get(int field$)
get
in interface org.apache.avro.generic.IndexedRecord
get
in class org.apache.avro.specific.SpecificRecordBase
public void put(int field$, Object value$)
put
in interface org.apache.avro.generic.IndexedRecord
put
in class org.apache.avro.specific.SpecificRecordBase
public CharSequence getName()
public void setName(CharSequence value)
value
- the value to set.public CharSequence getFavoriteNumber()
public void setFavoriteNumber(CharSequence value)
value
- the value to set.public CharSequence getFavoriteColor()
public void setFavoriteColor(CharSequence value)
value
- the value to set.public EventType getEventType()
public void setEventType(EventType value)
value
- the value to set.public static User.Builder newBuilder()
public static User.Builder newBuilder(User.Builder other)
other
- The existing builder to copy.public static User.Builder newBuilder(User other)
other
- The existing instance to copy.public void writeExternal(ObjectOutput out) throws IOException
IOException
public void readExternal(ObjectInput in) throws IOException
IOException
protected boolean hasCustomCoders()
public void customEncode(org.apache.avro.io.Encoder out) throws IOException
IOException
public void customDecode(org.apache.avro.io.ResolvingDecoder in) throws IOException
IOException
Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.