com.tfgco.pushnotification.PushFeedback Maven / Gradle / Ivy
The newest version!
/**
* Autogenerated by Avro
*
* DO NOT EDIT DIRECTLY
*/
package com.tfgco.pushnotification;
import org.apache.avro.specific.SpecificData;
@SuppressWarnings("all")
@org.apache.avro.specific.AvroGenerated
public class PushFeedback extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {
private static final long serialVersionUID = 71322009310995055L;
public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"PushFeedback\",\"namespace\":\"com.tfgco.pushnotification\",\"fields\":[{\"name\":\"to\",\"type\":\"string\"},{\"name\":\"timestamp\",\"type\":\"long\"},{\"name\":\"metadata\",\"type\":{\"type\":\"map\",\"values\":\"string\"},\"default\":{}},{\"name\":\"sent\",\"type\":\"boolean\"},{\"name\":\"reason\",\"type\":\"string\",\"default\":\"\"}]}");
public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
@Deprecated public java.lang.CharSequence to;
@Deprecated public long timestamp;
@Deprecated public java.util.Map metadata;
@Deprecated public boolean sent;
@Deprecated public java.lang.CharSequence reason;
/**
* Default constructor. Note that this does not initialize fields
* to their default values from the schema. If that is desired then
* one should use newBuilder().
*/
public PushFeedback() {}
/**
* All-args constructor.
* @param to The new value for to
* @param timestamp The new value for timestamp
* @param metadata The new value for metadata
* @param sent The new value for sent
* @param reason The new value for reason
*/
public PushFeedback(java.lang.CharSequence to, java.lang.Long timestamp, java.util.Map metadata, java.lang.Boolean sent, java.lang.CharSequence reason) {
this.to = to;
this.timestamp = timestamp;
this.metadata = metadata;
this.sent = sent;
this.reason = reason;
}
public org.apache.avro.Schema getSchema() { return SCHEMA$; }
// Used by DatumWriter. Applications should not call.
public java.lang.Object get(int field$) {
switch (field$) {
case 0: return to;
case 1: return timestamp;
case 2: return metadata;
case 3: return sent;
case 4: return reason;
default: throw new org.apache.avro.AvroRuntimeException("Bad index");
}
}
// Used by DatumReader. Applications should not call.
@SuppressWarnings(value="unchecked")
public void put(int field$, java.lang.Object value$) {
switch (field$) {
case 0: to = (java.lang.CharSequence)value$; break;
case 1: timestamp = (java.lang.Long)value$; break;
case 2: metadata = (java.util.Map)value$; break;
case 3: sent = (java.lang.Boolean)value$; break;
case 4: reason = (java.lang.CharSequence)value$; break;
default: throw new org.apache.avro.AvroRuntimeException("Bad index");
}
}
/**
* Gets the value of the 'to' field.
* @return The value of the 'to' field.
*/
public java.lang.CharSequence getTo() {
return to;
}
/**
* Sets the value of the 'to' field.
* @param value the value to set.
*/
public void setTo(java.lang.CharSequence value) {
this.to = value;
}
/**
* Gets the value of the 'timestamp' field.
* @return The value of the 'timestamp' field.
*/
public java.lang.Long getTimestamp() {
return timestamp;
}
/**
* Sets the value of the 'timestamp' field.
* @param value the value to set.
*/
public void setTimestamp(java.lang.Long value) {
this.timestamp = value;
}
/**
* Gets the value of the 'metadata' field.
* @return The value of the 'metadata' field.
*/
public java.util.Map getMetadata() {
return metadata;
}
/**
* Sets the value of the 'metadata' field.
* @param value the value to set.
*/
public void setMetadata(java.util.Map value) {
this.metadata = value;
}
/**
* Gets the value of the 'sent' field.
* @return The value of the 'sent' field.
*/
public java.lang.Boolean getSent() {
return sent;
}
/**
* Sets the value of the 'sent' field.
* @param value the value to set.
*/
public void setSent(java.lang.Boolean value) {
this.sent = value;
}
/**
* Gets the value of the 'reason' field.
* @return The value of the 'reason' field.
*/
public java.lang.CharSequence getReason() {
return reason;
}
/**
* Sets the value of the 'reason' field.
* @param value the value to set.
*/
public void setReason(java.lang.CharSequence value) {
this.reason = value;
}
/**
* Creates a new PushFeedback RecordBuilder.
* @return A new PushFeedback RecordBuilder
*/
public static com.tfgco.pushnotification.PushFeedback.Builder newBuilder() {
return new com.tfgco.pushnotification.PushFeedback.Builder();
}
/**
* Creates a new PushFeedback RecordBuilder by copying an existing Builder.
* @param other The existing builder to copy.
* @return A new PushFeedback RecordBuilder
*/
public static com.tfgco.pushnotification.PushFeedback.Builder newBuilder(com.tfgco.pushnotification.PushFeedback.Builder other) {
return new com.tfgco.pushnotification.PushFeedback.Builder(other);
}
/**
* Creates a new PushFeedback RecordBuilder by copying an existing PushFeedback instance.
* @param other The existing instance to copy.
* @return A new PushFeedback RecordBuilder
*/
public static com.tfgco.pushnotification.PushFeedback.Builder newBuilder(com.tfgco.pushnotification.PushFeedback other) {
return new com.tfgco.pushnotification.PushFeedback.Builder(other);
}
/**
* RecordBuilder for PushFeedback instances.
*/
public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase
implements org.apache.avro.data.RecordBuilder {
private java.lang.CharSequence to;
private long timestamp;
private java.util.Map metadata;
private boolean sent;
private java.lang.CharSequence reason;
/** Creates a new Builder */
private Builder() {
super(SCHEMA$);
}
/**
* Creates a Builder by copying an existing Builder.
* @param other The existing Builder to copy.
*/
private Builder(com.tfgco.pushnotification.PushFeedback.Builder other) {
super(other);
if (isValidValue(fields()[0], other.to)) {
this.to = data().deepCopy(fields()[0].schema(), other.to);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.timestamp)) {
this.timestamp = data().deepCopy(fields()[1].schema(), other.timestamp);
fieldSetFlags()[1] = true;
}
if (isValidValue(fields()[2], other.metadata)) {
this.metadata = data().deepCopy(fields()[2].schema(), other.metadata);
fieldSetFlags()[2] = true;
}
if (isValidValue(fields()[3], other.sent)) {
this.sent = data().deepCopy(fields()[3].schema(), other.sent);
fieldSetFlags()[3] = true;
}
if (isValidValue(fields()[4], other.reason)) {
this.reason = data().deepCopy(fields()[4].schema(), other.reason);
fieldSetFlags()[4] = true;
}
}
/**
* Creates a Builder by copying an existing PushFeedback instance
* @param other The existing instance to copy.
*/
private Builder(com.tfgco.pushnotification.PushFeedback other) {
super(SCHEMA$);
if (isValidValue(fields()[0], other.to)) {
this.to = data().deepCopy(fields()[0].schema(), other.to);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.timestamp)) {
this.timestamp = data().deepCopy(fields()[1].schema(), other.timestamp);
fieldSetFlags()[1] = true;
}
if (isValidValue(fields()[2], other.metadata)) {
this.metadata = data().deepCopy(fields()[2].schema(), other.metadata);
fieldSetFlags()[2] = true;
}
if (isValidValue(fields()[3], other.sent)) {
this.sent = data().deepCopy(fields()[3].schema(), other.sent);
fieldSetFlags()[3] = true;
}
if (isValidValue(fields()[4], other.reason)) {
this.reason = data().deepCopy(fields()[4].schema(), other.reason);
fieldSetFlags()[4] = true;
}
}
/**
* Gets the value of the 'to' field.
* @return The value.
*/
public java.lang.CharSequence getTo() {
return to;
}
/**
* Sets the value of the 'to' field.
* @param value The value of 'to'.
* @return This builder.
*/
public com.tfgco.pushnotification.PushFeedback.Builder setTo(java.lang.CharSequence value) {
validate(fields()[0], value);
this.to = value;
fieldSetFlags()[0] = true;
return this;
}
/**
* Checks whether the 'to' field has been set.
* @return True if the 'to' field has been set, false otherwise.
*/
public boolean hasTo() {
return fieldSetFlags()[0];
}
/**
* Clears the value of the 'to' field.
* @return This builder.
*/
public com.tfgco.pushnotification.PushFeedback.Builder clearTo() {
to = null;
fieldSetFlags()[0] = false;
return this;
}
/**
* Gets the value of the 'timestamp' field.
* @return The value.
*/
public java.lang.Long getTimestamp() {
return timestamp;
}
/**
* Sets the value of the 'timestamp' field.
* @param value The value of 'timestamp'.
* @return This builder.
*/
public com.tfgco.pushnotification.PushFeedback.Builder setTimestamp(long value) {
validate(fields()[1], value);
this.timestamp = value;
fieldSetFlags()[1] = true;
return this;
}
/**
* Checks whether the 'timestamp' field has been set.
* @return True if the 'timestamp' field has been set, false otherwise.
*/
public boolean hasTimestamp() {
return fieldSetFlags()[1];
}
/**
* Clears the value of the 'timestamp' field.
* @return This builder.
*/
public com.tfgco.pushnotification.PushFeedback.Builder clearTimestamp() {
fieldSetFlags()[1] = false;
return this;
}
/**
* Gets the value of the 'metadata' field.
* @return The value.
*/
public java.util.Map getMetadata() {
return metadata;
}
/**
* Sets the value of the 'metadata' field.
* @param value The value of 'metadata'.
* @return This builder.
*/
public com.tfgco.pushnotification.PushFeedback.Builder setMetadata(java.util.Map value) {
validate(fields()[2], value);
this.metadata = value;
fieldSetFlags()[2] = true;
return this;
}
/**
* Checks whether the 'metadata' field has been set.
* @return True if the 'metadata' field has been set, false otherwise.
*/
public boolean hasMetadata() {
return fieldSetFlags()[2];
}
/**
* Clears the value of the 'metadata' field.
* @return This builder.
*/
public com.tfgco.pushnotification.PushFeedback.Builder clearMetadata() {
metadata = null;
fieldSetFlags()[2] = false;
return this;
}
/**
* Gets the value of the 'sent' field.
* @return The value.
*/
public java.lang.Boolean getSent() {
return sent;
}
/**
* Sets the value of the 'sent' field.
* @param value The value of 'sent'.
* @return This builder.
*/
public com.tfgco.pushnotification.PushFeedback.Builder setSent(boolean value) {
validate(fields()[3], value);
this.sent = value;
fieldSetFlags()[3] = true;
return this;
}
/**
* Checks whether the 'sent' field has been set.
* @return True if the 'sent' field has been set, false otherwise.
*/
public boolean hasSent() {
return fieldSetFlags()[3];
}
/**
* Clears the value of the 'sent' field.
* @return This builder.
*/
public com.tfgco.pushnotification.PushFeedback.Builder clearSent() {
fieldSetFlags()[3] = false;
return this;
}
/**
* Gets the value of the 'reason' field.
* @return The value.
*/
public java.lang.CharSequence getReason() {
return reason;
}
/**
* Sets the value of the 'reason' field.
* @param value The value of 'reason'.
* @return This builder.
*/
public com.tfgco.pushnotification.PushFeedback.Builder setReason(java.lang.CharSequence value) {
validate(fields()[4], value);
this.reason = value;
fieldSetFlags()[4] = true;
return this;
}
/**
* Checks whether the 'reason' field has been set.
* @return True if the 'reason' field has been set, false otherwise.
*/
public boolean hasReason() {
return fieldSetFlags()[4];
}
/**
* Clears the value of the 'reason' field.
* @return This builder.
*/
public com.tfgco.pushnotification.PushFeedback.Builder clearReason() {
reason = null;
fieldSetFlags()[4] = false;
return this;
}
@Override
public PushFeedback build() {
try {
PushFeedback record = new PushFeedback();
record.to = fieldSetFlags()[0] ? this.to : (java.lang.CharSequence) defaultValue(fields()[0]);
record.timestamp = fieldSetFlags()[1] ? this.timestamp : (java.lang.Long) defaultValue(fields()[1]);
record.metadata = fieldSetFlags()[2] ? this.metadata : (java.util.Map) defaultValue(fields()[2]);
record.sent = fieldSetFlags()[3] ? this.sent : (java.lang.Boolean) defaultValue(fields()[3]);
record.reason = fieldSetFlags()[4] ? this.reason : (java.lang.CharSequence) defaultValue(fields()[4]);
return record;
} catch (Exception e) {
throw new org.apache.avro.AvroRuntimeException(e);
}
}
}
private static final org.apache.avro.io.DatumWriter
WRITER$ = new org.apache.avro.specific.SpecificDatumWriter(SCHEMA$);
@Override public void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException {
WRITER$.write(this, SpecificData.getEncoder(out));
}
private static final org.apache.avro.io.DatumReader
READER$ = new org.apache.avro.specific.SpecificDatumReader(SCHEMA$);
@Override public void readExternal(java.io.ObjectInput in)
throws java.io.IOException {
READER$.read(this, SpecificData.getDecoder(in));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy