Package com.bakdata.kafka
Class DeadLetter
- java.lang.Object
-
- org.apache.avro.specific.SpecificRecordBase
-
- com.bakdata.kafka.DeadLetter
-
- All Implemented Interfaces:
java.io.Externalizable,java.io.Serializable,java.lang.Comparable<org.apache.avro.specific.SpecificRecord>,org.apache.avro.generic.GenericContainer,org.apache.avro.generic.GenericRecord,org.apache.avro.generic.IndexedRecord,org.apache.avro.specific.SpecificRecord
public class DeadLetter extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDeadLetter.BuilderRecordBuilder for DeadLetter instances.
-
Field Summary
Fields Modifier and Type Field Description static org.apache.avro.SchemaSCHEMA$
-
Constructor Summary
Constructors Constructor Description DeadLetter()Default constructor.DeadLetter(java.lang.String input_value, java.lang.String topic, java.lang.Integer partition, java.lang.Long offset, java.lang.String description, ErrorDescription cause)All-args constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static org.apache.avro.message.BinaryMessageDecoder<DeadLetter>createDecoder(org.apache.avro.message.SchemaStore resolver)Create a new BinaryMessageDecoder instance for this class that uses the specifiedSchemaStore.voidcustomDecode(org.apache.avro.io.ResolvingDecoder in)voidcustomEncode(org.apache.avro.io.Encoder out)static DeadLetterfromByteBuffer(java.nio.ByteBuffer b)Deserializes a DeadLetter from a ByteBuffer.java.lang.Objectget(int field$)ErrorDescriptiongetCause()Gets the value of the 'cause' field.static org.apache.avro.SchemagetClassSchema()static org.apache.avro.message.BinaryMessageDecoder<DeadLetter>getDecoder()Return the BinaryMessageDecoder instance used by this class.java.lang.StringgetDescription()Gets the value of the 'description' field.static org.apache.avro.message.BinaryMessageEncoder<DeadLetter>getEncoder()Return the BinaryMessageEncoder instance used by this class.java.util.Optional<java.lang.String>getInputValue()Gets the value of the 'input_value' field as an Optional<java.lang.String>.java.util.Optional<java.lang.Long>getOffset()Gets the value of the 'offset' field as an Optional<java.lang.Long>.java.util.Optional<java.lang.Integer>getPartition()Gets the value of the 'partition' field as an Optional<java.lang.Integer>.org.apache.avro.SchemagetSchema()org.apache.avro.specific.SpecificDatagetSpecificData()java.util.Optional<java.lang.String>getTopic()Gets the value of the 'topic' field as an Optional<java.lang.String>.protected booleanhasCustomCoders()static DeadLetter.BuildernewBuilder()Creates a new DeadLetter RecordBuilder.static DeadLetter.BuildernewBuilder(DeadLetter other)Creates a new DeadLetter RecordBuilder by copying an existing DeadLetter instance.static DeadLetter.BuildernewBuilder(DeadLetter.Builder other)Creates a new DeadLetter RecordBuilder by copying an existing Builder.voidput(int field$, java.lang.Object value$)voidreadExternal(java.io.ObjectInput in)voidsetCause(ErrorDescription value)Sets the value of the 'cause' field.voidsetDescription(java.lang.String value)Sets the value of the 'description' field.voidsetInputValue(java.lang.String value)Sets the value of the 'input_value' field.voidsetOffset(java.lang.Long value)Sets the value of the 'offset' field.voidsetPartition(java.lang.Integer value)Sets the value of the 'partition' field.voidsetTopic(java.lang.String value)Sets the value of the 'topic' field.java.nio.ByteBuffertoByteBuffer()Serializes this DeadLetter to a ByteBuffer.voidwriteExternal(java.io.ObjectOutput out)-
Methods inherited from class org.apache.avro.specific.SpecificRecordBase
compareTo, equals, get, getConversion, getConversion, hashCode, put, toString
-
-
-
-
Constructor Detail
-
DeadLetter
public DeadLetter()
Default constructor. Note that this does not initialize fields to their default values from the schema. If that is desired then one should usenewBuilder().
-
DeadLetter
public DeadLetter(java.lang.String input_value, java.lang.String topic, java.lang.Integer partition, java.lang.Long offset, java.lang.String description, ErrorDescription cause)All-args constructor.- Parameters:
input_value- The new value for input_valuetopic- The new value for topicpartition- The new value for partitionoffset- The new value for offsetdescription- The new value for descriptioncause- The new value for cause
-
-
Method Detail
-
getClassSchema
public static org.apache.avro.Schema getClassSchema()
-
getEncoder
public static org.apache.avro.message.BinaryMessageEncoder<DeadLetter> getEncoder()
Return the BinaryMessageEncoder instance used by this class.- Returns:
- the message encoder used by this class
-
getDecoder
public static org.apache.avro.message.BinaryMessageDecoder<DeadLetter> getDecoder()
Return the BinaryMessageDecoder instance used by this class.- Returns:
- the message decoder used by this class
-
createDecoder
public static org.apache.avro.message.BinaryMessageDecoder<DeadLetter> createDecoder(org.apache.avro.message.SchemaStore resolver)
Create a new BinaryMessageDecoder instance for this class that uses the specifiedSchemaStore.- Parameters:
resolver- aSchemaStoreused to find schemas by fingerprint- Returns:
- a BinaryMessageDecoder instance for this class backed by the given SchemaStore
-
toByteBuffer
public java.nio.ByteBuffer toByteBuffer() throws java.io.IOExceptionSerializes this DeadLetter to a ByteBuffer.- Returns:
- a buffer holding the serialized data for this instance
- Throws:
java.io.IOException- if this instance could not be serialized
-
fromByteBuffer
public static DeadLetter fromByteBuffer(java.nio.ByteBuffer b) throws java.io.IOException
Deserializes a DeadLetter from a ByteBuffer.- Parameters:
b- a byte buffer holding serialized data for an instance of this class- Returns:
- a DeadLetter instance decoded from the given buffer
- Throws:
java.io.IOException- if the given bytes could not be deserialized into an instance of this class
-
getSpecificData
public org.apache.avro.specific.SpecificData getSpecificData()
- Overrides:
getSpecificDatain classorg.apache.avro.specific.SpecificRecordBase
-
getSchema
public org.apache.avro.Schema getSchema()
- Specified by:
getSchemain interfaceorg.apache.avro.generic.GenericContainer- Specified by:
getSchemain classorg.apache.avro.specific.SpecificRecordBase
-
get
public java.lang.Object get(int field$)
- Specified by:
getin interfaceorg.apache.avro.generic.IndexedRecord- Specified by:
getin classorg.apache.avro.specific.SpecificRecordBase
-
put
public void put(int field$, java.lang.Object value$)- Specified by:
putin interfaceorg.apache.avro.generic.IndexedRecord- Specified by:
putin classorg.apache.avro.specific.SpecificRecordBase
-
getInputValue
public java.util.Optional<java.lang.String> getInputValue()
Gets the value of the 'input_value' field as an Optional<java.lang.String>.- Returns:
- The value wrapped in an Optional<java.lang.String>.
-
setInputValue
public void setInputValue(java.lang.String value)
Sets the value of the 'input_value' field.- Parameters:
value- the value to set.
-
getTopic
public java.util.Optional<java.lang.String> getTopic()
Gets the value of the 'topic' field as an Optional<java.lang.String>.- Returns:
- The value wrapped in an Optional<java.lang.String>.
-
setTopic
public void setTopic(java.lang.String value)
Sets the value of the 'topic' field.- Parameters:
value- the value to set.
-
getPartition
public java.util.Optional<java.lang.Integer> getPartition()
Gets the value of the 'partition' field as an Optional<java.lang.Integer>.- Returns:
- The value wrapped in an Optional<java.lang.Integer>.
-
setPartition
public void setPartition(java.lang.Integer value)
Sets the value of the 'partition' field.- Parameters:
value- the value to set.
-
getOffset
public java.util.Optional<java.lang.Long> getOffset()
Gets the value of the 'offset' field as an Optional<java.lang.Long>.- Returns:
- The value wrapped in an Optional<java.lang.Long>.
-
setOffset
public void setOffset(java.lang.Long value)
Sets the value of the 'offset' field.- Parameters:
value- the value to set.
-
getDescription
public java.lang.String getDescription()
Gets the value of the 'description' field.- Returns:
- The value of the 'description' field.
-
setDescription
public void setDescription(java.lang.String value)
Sets the value of the 'description' field.- Parameters:
value- the value to set.
-
getCause
public ErrorDescription getCause()
Gets the value of the 'cause' field.- Returns:
- The value of the 'cause' field.
-
setCause
public void setCause(ErrorDescription value)
Sets the value of the 'cause' field.- Parameters:
value- the value to set.
-
newBuilder
public static DeadLetter.Builder newBuilder()
Creates a new DeadLetter RecordBuilder.- Returns:
- A new DeadLetter RecordBuilder
-
newBuilder
public static DeadLetter.Builder newBuilder(DeadLetter.Builder other)
Creates a new DeadLetter RecordBuilder by copying an existing Builder.- Parameters:
other- The existing builder to copy.- Returns:
- A new DeadLetter RecordBuilder
-
newBuilder
public static DeadLetter.Builder newBuilder(DeadLetter other)
Creates a new DeadLetter RecordBuilder by copying an existing DeadLetter instance.- Parameters:
other- The existing instance to copy.- Returns:
- A new DeadLetter RecordBuilder
-
writeExternal
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException- Specified by:
writeExternalin interfacejava.io.Externalizable- Overrides:
writeExternalin classorg.apache.avro.specific.SpecificRecordBase- Throws:
java.io.IOException
-
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOException- Specified by:
readExternalin interfacejava.io.Externalizable- Overrides:
readExternalin classorg.apache.avro.specific.SpecificRecordBase- Throws:
java.io.IOException
-
hasCustomCoders
protected boolean hasCustomCoders()
- Overrides:
hasCustomCodersin classorg.apache.avro.specific.SpecificRecordBase
-
customEncode
public void customEncode(org.apache.avro.io.Encoder out) throws java.io.IOException- Overrides:
customEncodein classorg.apache.avro.specific.SpecificRecordBase- Throws:
java.io.IOException
-
customDecode
public void customDecode(org.apache.avro.io.ResolvingDecoder in) throws java.io.IOException- Overrides:
customDecodein classorg.apache.avro.specific.SpecificRecordBase- Throws:
java.io.IOException
-
-