net.lightapi.portal.covid.CovidEntityCreatedEvent Maven / Gradle / Ivy
The newest version!
/**
* Autogenerated by Avro
*
* DO NOT EDIT DIRECTLY
*/
package net.lightapi.portal.covid;
import org.apache.avro.generic.GenericArray;
import org.apache.avro.specific.SpecificData;
import org.apache.avro.util.Utf8;
import org.apache.avro.message.BinaryMessageEncoder;
import org.apache.avro.message.BinaryMessageDecoder;
import org.apache.avro.message.SchemaStore;
@org.apache.avro.specific.AvroGenerated
public class CovidEntityCreatedEvent extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {
private static final long serialVersionUID = -3265715052001421454L;
public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"CovidEntityCreatedEvent\",\"namespace\":\"net.lightapi.portal.covid\",\"fields\":[{\"name\":\"EventId\",\"type\":{\"type\":\"record\",\"name\":\"EventId\",\"namespace\":\"com.networknt.kafka.common\",\"fields\":[{\"name\":\"id\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"doc\":\"a unique identifier\"},{\"name\":\"nonce\",\"type\":\"long\",\"doc\":\"the number of the transactions for the user\"},{\"name\":\"derived\",\"type\":\"boolean\",\"doc\":\"indicate if the event is derived from event processor\",\"default\":false}]}},{\"name\":\"key\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"doc\":\"country, province and city combination\"},{\"name\":\"keyId\",\"type\":\"int\",\"doc\":\"keyId 0 entityId 1 map category 1 map subcategory\",\"default\":0},{\"name\":\"userId\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"doc\":\"the unique user id\"},{\"name\":\"category\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"doc\":\"category\"},{\"name\":\"subcategory\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"doc\":\"subcategory\"},{\"name\":\"latitude\",\"type\":\"double\",\"doc\":\"latitude\"},{\"name\":\"longitude\",\"type\":\"double\",\"doc\":\"city longitude\"},{\"name\":\"introduction\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"doc\":\"introduction\"},{\"name\":\"timestamp\",\"type\":\"long\",\"doc\":\"time the event is recorded\",\"default\":0}]}");
public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
private static final SpecificData MODEL$ = new SpecificData();
private static final BinaryMessageEncoder ENCODER =
new BinaryMessageEncoder(MODEL$, SCHEMA$);
private static final BinaryMessageDecoder DECODER =
new BinaryMessageDecoder(MODEL$, SCHEMA$);
/**
* Return the BinaryMessageEncoder instance used by this class.
* @return the message encoder used by this class
*/
public static BinaryMessageEncoder getEncoder() {
return ENCODER;
}
/**
* Return the BinaryMessageDecoder instance used by this class.
* @return the message decoder used by this class
*/
public static BinaryMessageDecoder getDecoder() {
return DECODER;
}
/**
* Create a new BinaryMessageDecoder instance for this class that uses the specified {@link SchemaStore}.
* @param resolver a {@link SchemaStore} used to find schemas by fingerprint
* @return a BinaryMessageDecoder instance for this class backed by the given SchemaStore
*/
public static BinaryMessageDecoder createDecoder(SchemaStore resolver) {
return new BinaryMessageDecoder(MODEL$, SCHEMA$, resolver);
}
/**
* Serializes this CovidEntityCreatedEvent to a ByteBuffer.
* @return a buffer holding the serialized data for this instance
* @throws java.io.IOException if this instance could not be serialized
*/
public java.nio.ByteBuffer toByteBuffer() throws java.io.IOException {
return ENCODER.encode(this);
}
/**
* Deserializes a CovidEntityCreatedEvent from a ByteBuffer.
* @param b a byte buffer holding serialized data for an instance of this class
* @return a CovidEntityCreatedEvent instance decoded from the given buffer
* @throws java.io.IOException if the given bytes could not be deserialized into an instance of this class
*/
public static CovidEntityCreatedEvent fromByteBuffer(
java.nio.ByteBuffer b) throws java.io.IOException {
return DECODER.decode(b);
}
private com.networknt.kafka.common.EventId EventId;
/** country, province and city combination */
private java.lang.String key;
/** keyId 0 entityId 1 map category 1 map subcategory */
private int keyId;
/** the unique user id */
private java.lang.String userId;
/** category */
private java.lang.String category;
/** subcategory */
private java.lang.String subcategory;
/** latitude */
private double latitude;
/** city longitude */
private double longitude;
/** introduction */
private java.lang.String introduction;
/** time the event is recorded */
private long timestamp;
/**
* 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 CovidEntityCreatedEvent() {}
/**
* All-args constructor.
* @param EventId The new value for EventId
* @param key country, province and city combination
* @param keyId keyId 0 entityId 1 map category 1 map subcategory
* @param userId the unique user id
* @param category category
* @param subcategory subcategory
* @param latitude latitude
* @param longitude city longitude
* @param introduction introduction
* @param timestamp time the event is recorded
*/
public CovidEntityCreatedEvent(com.networknt.kafka.common.EventId EventId, java.lang.String key, java.lang.Integer keyId, java.lang.String userId, java.lang.String category, java.lang.String subcategory, java.lang.Double latitude, java.lang.Double longitude, java.lang.String introduction, java.lang.Long timestamp) {
this.EventId = EventId;
this.key = key;
this.keyId = keyId;
this.userId = userId;
this.category = category;
this.subcategory = subcategory;
this.latitude = latitude;
this.longitude = longitude;
this.introduction = introduction;
this.timestamp = timestamp;
}
public org.apache.avro.specific.SpecificData getSpecificData() { return MODEL$; }
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 EventId;
case 1: return key;
case 2: return keyId;
case 3: return userId;
case 4: return category;
case 5: return subcategory;
case 6: return latitude;
case 7: return longitude;
case 8: return introduction;
case 9: return timestamp;
default: throw new IndexOutOfBoundsException("Invalid index: " + field$);
}
}
// Used by DatumReader. Applications should not call.
@SuppressWarnings(value="unchecked")
public void put(int field$, java.lang.Object value$) {
switch (field$) {
case 0: EventId = (com.networknt.kafka.common.EventId)value$; break;
case 1: key = value$ != null ? value$.toString() : null; break;
case 2: keyId = (java.lang.Integer)value$; break;
case 3: userId = value$ != null ? value$.toString() : null; break;
case 4: category = value$ != null ? value$.toString() : null; break;
case 5: subcategory = value$ != null ? value$.toString() : null; break;
case 6: latitude = (java.lang.Double)value$; break;
case 7: longitude = (java.lang.Double)value$; break;
case 8: introduction = value$ != null ? value$.toString() : null; break;
case 9: timestamp = (java.lang.Long)value$; break;
default: throw new IndexOutOfBoundsException("Invalid index: " + field$);
}
}
/**
* Gets the value of the 'EventId' field.
* @return The value of the 'EventId' field.
*/
public com.networknt.kafka.common.EventId getEventId() {
return EventId;
}
/**
* Sets the value of the 'EventId' field.
* @param value the value to set.
*/
public void setEventId(com.networknt.kafka.common.EventId value) {
this.EventId = value;
}
/**
* Gets the value of the 'key' field.
* @return country, province and city combination
*/
public java.lang.String getKey() {
return key;
}
/**
* Sets the value of the 'key' field.
* country, province and city combination
* @param value the value to set.
*/
public void setKey(java.lang.String value) {
this.key = value;
}
/**
* Gets the value of the 'keyId' field.
* @return keyId 0 entityId 1 map category 1 map subcategory
*/
public int getKeyId() {
return keyId;
}
/**
* Sets the value of the 'keyId' field.
* keyId 0 entityId 1 map category 1 map subcategory
* @param value the value to set.
*/
public void setKeyId(int value) {
this.keyId = value;
}
/**
* Gets the value of the 'userId' field.
* @return the unique user id
*/
public java.lang.String getUserId() {
return userId;
}
/**
* Sets the value of the 'userId' field.
* the unique user id
* @param value the value to set.
*/
public void setUserId(java.lang.String value) {
this.userId = value;
}
/**
* Gets the value of the 'category' field.
* @return category
*/
public java.lang.String getCategory() {
return category;
}
/**
* Sets the value of the 'category' field.
* category
* @param value the value to set.
*/
public void setCategory(java.lang.String value) {
this.category = value;
}
/**
* Gets the value of the 'subcategory' field.
* @return subcategory
*/
public java.lang.String getSubcategory() {
return subcategory;
}
/**
* Sets the value of the 'subcategory' field.
* subcategory
* @param value the value to set.
*/
public void setSubcategory(java.lang.String value) {
this.subcategory = value;
}
/**
* Gets the value of the 'latitude' field.
* @return latitude
*/
public double getLatitude() {
return latitude;
}
/**
* Sets the value of the 'latitude' field.
* latitude
* @param value the value to set.
*/
public void setLatitude(double value) {
this.latitude = value;
}
/**
* Gets the value of the 'longitude' field.
* @return city longitude
*/
public double getLongitude() {
return longitude;
}
/**
* Sets the value of the 'longitude' field.
* city longitude
* @param value the value to set.
*/
public void setLongitude(double value) {
this.longitude = value;
}
/**
* Gets the value of the 'introduction' field.
* @return introduction
*/
public java.lang.String getIntroduction() {
return introduction;
}
/**
* Sets the value of the 'introduction' field.
* introduction
* @param value the value to set.
*/
public void setIntroduction(java.lang.String value) {
this.introduction = value;
}
/**
* Gets the value of the 'timestamp' field.
* @return time the event is recorded
*/
public long getTimestamp() {
return timestamp;
}
/**
* Sets the value of the 'timestamp' field.
* time the event is recorded
* @param value the value to set.
*/
public void setTimestamp(long value) {
this.timestamp = value;
}
/**
* Creates a new CovidEntityCreatedEvent RecordBuilder.
* @return A new CovidEntityCreatedEvent RecordBuilder
*/
public static net.lightapi.portal.covid.CovidEntityCreatedEvent.Builder newBuilder() {
return new net.lightapi.portal.covid.CovidEntityCreatedEvent.Builder();
}
/**
* Creates a new CovidEntityCreatedEvent RecordBuilder by copying an existing Builder.
* @param other The existing builder to copy.
* @return A new CovidEntityCreatedEvent RecordBuilder
*/
public static net.lightapi.portal.covid.CovidEntityCreatedEvent.Builder newBuilder(net.lightapi.portal.covid.CovidEntityCreatedEvent.Builder other) {
if (other == null) {
return new net.lightapi.portal.covid.CovidEntityCreatedEvent.Builder();
} else {
return new net.lightapi.portal.covid.CovidEntityCreatedEvent.Builder(other);
}
}
/**
* Creates a new CovidEntityCreatedEvent RecordBuilder by copying an existing CovidEntityCreatedEvent instance.
* @param other The existing instance to copy.
* @return A new CovidEntityCreatedEvent RecordBuilder
*/
public static net.lightapi.portal.covid.CovidEntityCreatedEvent.Builder newBuilder(net.lightapi.portal.covid.CovidEntityCreatedEvent other) {
if (other == null) {
return new net.lightapi.portal.covid.CovidEntityCreatedEvent.Builder();
} else {
return new net.lightapi.portal.covid.CovidEntityCreatedEvent.Builder(other);
}
}
/**
* RecordBuilder for CovidEntityCreatedEvent instances.
*/
@org.apache.avro.specific.AvroGenerated
public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase
implements org.apache.avro.data.RecordBuilder {
private com.networknt.kafka.common.EventId EventId;
private com.networknt.kafka.common.EventId.Builder EventIdBuilder;
/** country, province and city combination */
private java.lang.String key;
/** keyId 0 entityId 1 map category 1 map subcategory */
private int keyId;
/** the unique user id */
private java.lang.String userId;
/** category */
private java.lang.String category;
/** subcategory */
private java.lang.String subcategory;
/** latitude */
private double latitude;
/** city longitude */
private double longitude;
/** introduction */
private java.lang.String introduction;
/** time the event is recorded */
private long timestamp;
/** Creates a new Builder */
private Builder() {
super(SCHEMA$, MODEL$);
}
/**
* Creates a Builder by copying an existing Builder.
* @param other The existing Builder to copy.
*/
private Builder(net.lightapi.portal.covid.CovidEntityCreatedEvent.Builder other) {
super(other);
if (isValidValue(fields()[0], other.EventId)) {
this.EventId = data().deepCopy(fields()[0].schema(), other.EventId);
fieldSetFlags()[0] = other.fieldSetFlags()[0];
}
if (other.hasEventIdBuilder()) {
this.EventIdBuilder = com.networknt.kafka.common.EventId.newBuilder(other.getEventIdBuilder());
}
if (isValidValue(fields()[1], other.key)) {
this.key = data().deepCopy(fields()[1].schema(), other.key);
fieldSetFlags()[1] = other.fieldSetFlags()[1];
}
if (isValidValue(fields()[2], other.keyId)) {
this.keyId = data().deepCopy(fields()[2].schema(), other.keyId);
fieldSetFlags()[2] = other.fieldSetFlags()[2];
}
if (isValidValue(fields()[3], other.userId)) {
this.userId = data().deepCopy(fields()[3].schema(), other.userId);
fieldSetFlags()[3] = other.fieldSetFlags()[3];
}
if (isValidValue(fields()[4], other.category)) {
this.category = data().deepCopy(fields()[4].schema(), other.category);
fieldSetFlags()[4] = other.fieldSetFlags()[4];
}
if (isValidValue(fields()[5], other.subcategory)) {
this.subcategory = data().deepCopy(fields()[5].schema(), other.subcategory);
fieldSetFlags()[5] = other.fieldSetFlags()[5];
}
if (isValidValue(fields()[6], other.latitude)) {
this.latitude = data().deepCopy(fields()[6].schema(), other.latitude);
fieldSetFlags()[6] = other.fieldSetFlags()[6];
}
if (isValidValue(fields()[7], other.longitude)) {
this.longitude = data().deepCopy(fields()[7].schema(), other.longitude);
fieldSetFlags()[7] = other.fieldSetFlags()[7];
}
if (isValidValue(fields()[8], other.introduction)) {
this.introduction = data().deepCopy(fields()[8].schema(), other.introduction);
fieldSetFlags()[8] = other.fieldSetFlags()[8];
}
if (isValidValue(fields()[9], other.timestamp)) {
this.timestamp = data().deepCopy(fields()[9].schema(), other.timestamp);
fieldSetFlags()[9] = other.fieldSetFlags()[9];
}
}
/**
* Creates a Builder by copying an existing CovidEntityCreatedEvent instance
* @param other The existing instance to copy.
*/
private Builder(net.lightapi.portal.covid.CovidEntityCreatedEvent other) {
super(SCHEMA$, MODEL$);
if (isValidValue(fields()[0], other.EventId)) {
this.EventId = data().deepCopy(fields()[0].schema(), other.EventId);
fieldSetFlags()[0] = true;
}
this.EventIdBuilder = null;
if (isValidValue(fields()[1], other.key)) {
this.key = data().deepCopy(fields()[1].schema(), other.key);
fieldSetFlags()[1] = true;
}
if (isValidValue(fields()[2], other.keyId)) {
this.keyId = data().deepCopy(fields()[2].schema(), other.keyId);
fieldSetFlags()[2] = true;
}
if (isValidValue(fields()[3], other.userId)) {
this.userId = data().deepCopy(fields()[3].schema(), other.userId);
fieldSetFlags()[3] = true;
}
if (isValidValue(fields()[4], other.category)) {
this.category = data().deepCopy(fields()[4].schema(), other.category);
fieldSetFlags()[4] = true;
}
if (isValidValue(fields()[5], other.subcategory)) {
this.subcategory = data().deepCopy(fields()[5].schema(), other.subcategory);
fieldSetFlags()[5] = true;
}
if (isValidValue(fields()[6], other.latitude)) {
this.latitude = data().deepCopy(fields()[6].schema(), other.latitude);
fieldSetFlags()[6] = true;
}
if (isValidValue(fields()[7], other.longitude)) {
this.longitude = data().deepCopy(fields()[7].schema(), other.longitude);
fieldSetFlags()[7] = true;
}
if (isValidValue(fields()[8], other.introduction)) {
this.introduction = data().deepCopy(fields()[8].schema(), other.introduction);
fieldSetFlags()[8] = true;
}
if (isValidValue(fields()[9], other.timestamp)) {
this.timestamp = data().deepCopy(fields()[9].schema(), other.timestamp);
fieldSetFlags()[9] = true;
}
}
/**
* Gets the value of the 'EventId' field.
* @return The value.
*/
public com.networknt.kafka.common.EventId getEventId() {
return EventId;
}
/**
* Sets the value of the 'EventId' field.
* @param value The value of 'EventId'.
* @return This builder.
*/
public net.lightapi.portal.covid.CovidEntityCreatedEvent.Builder setEventId(com.networknt.kafka.common.EventId value) {
validate(fields()[0], value);
this.EventIdBuilder = null;
this.EventId = value;
fieldSetFlags()[0] = true;
return this;
}
/**
* Checks whether the 'EventId' field has been set.
* @return True if the 'EventId' field has been set, false otherwise.
*/
public boolean hasEventId() {
return fieldSetFlags()[0];
}
/**
* Gets the Builder instance for the 'EventId' field and creates one if it doesn't exist yet.
* @return This builder.
*/
public com.networknt.kafka.common.EventId.Builder getEventIdBuilder() {
if (EventIdBuilder == null) {
if (hasEventId()) {
setEventIdBuilder(com.networknt.kafka.common.EventId.newBuilder(EventId));
} else {
setEventIdBuilder(com.networknt.kafka.common.EventId.newBuilder());
}
}
return EventIdBuilder;
}
/**
* Sets the Builder instance for the 'EventId' field
* @param value The builder instance that must be set.
* @return This builder.
*/
public net.lightapi.portal.covid.CovidEntityCreatedEvent.Builder setEventIdBuilder(com.networknt.kafka.common.EventId.Builder value) {
clearEventId();
EventIdBuilder = value;
return this;
}
/**
* Checks whether the 'EventId' field has an active Builder instance
* @return True if the 'EventId' field has an active Builder instance
*/
public boolean hasEventIdBuilder() {
return EventIdBuilder != null;
}
/**
* Clears the value of the 'EventId' field.
* @return This builder.
*/
public net.lightapi.portal.covid.CovidEntityCreatedEvent.Builder clearEventId() {
EventId = null;
EventIdBuilder = null;
fieldSetFlags()[0] = false;
return this;
}
/**
* Gets the value of the 'key' field.
* country, province and city combination
* @return The value.
*/
public java.lang.String getKey() {
return key;
}
/**
* Sets the value of the 'key' field.
* country, province and city combination
* @param value The value of 'key'.
* @return This builder.
*/
public net.lightapi.portal.covid.CovidEntityCreatedEvent.Builder setKey(java.lang.String value) {
validate(fields()[1], value);
this.key = value;
fieldSetFlags()[1] = true;
return this;
}
/**
* Checks whether the 'key' field has been set.
* country, province and city combination
* @return True if the 'key' field has been set, false otherwise.
*/
public boolean hasKey() {
return fieldSetFlags()[1];
}
/**
* Clears the value of the 'key' field.
* country, province and city combination
* @return This builder.
*/
public net.lightapi.portal.covid.CovidEntityCreatedEvent.Builder clearKey() {
key = null;
fieldSetFlags()[1] = false;
return this;
}
/**
* Gets the value of the 'keyId' field.
* keyId 0 entityId 1 map category 1 map subcategory
* @return The value.
*/
public int getKeyId() {
return keyId;
}
/**
* Sets the value of the 'keyId' field.
* keyId 0 entityId 1 map category 1 map subcategory
* @param value The value of 'keyId'.
* @return This builder.
*/
public net.lightapi.portal.covid.CovidEntityCreatedEvent.Builder setKeyId(int value) {
validate(fields()[2], value);
this.keyId = value;
fieldSetFlags()[2] = true;
return this;
}
/**
* Checks whether the 'keyId' field has been set.
* keyId 0 entityId 1 map category 1 map subcategory
* @return True if the 'keyId' field has been set, false otherwise.
*/
public boolean hasKeyId() {
return fieldSetFlags()[2];
}
/**
* Clears the value of the 'keyId' field.
* keyId 0 entityId 1 map category 1 map subcategory
* @return This builder.
*/
public net.lightapi.portal.covid.CovidEntityCreatedEvent.Builder clearKeyId() {
fieldSetFlags()[2] = false;
return this;
}
/**
* Gets the value of the 'userId' field.
* the unique user id
* @return The value.
*/
public java.lang.String getUserId() {
return userId;
}
/**
* Sets the value of the 'userId' field.
* the unique user id
* @param value The value of 'userId'.
* @return This builder.
*/
public net.lightapi.portal.covid.CovidEntityCreatedEvent.Builder setUserId(java.lang.String value) {
validate(fields()[3], value);
this.userId = value;
fieldSetFlags()[3] = true;
return this;
}
/**
* Checks whether the 'userId' field has been set.
* the unique user id
* @return True if the 'userId' field has been set, false otherwise.
*/
public boolean hasUserId() {
return fieldSetFlags()[3];
}
/**
* Clears the value of the 'userId' field.
* the unique user id
* @return This builder.
*/
public net.lightapi.portal.covid.CovidEntityCreatedEvent.Builder clearUserId() {
userId = null;
fieldSetFlags()[3] = false;
return this;
}
/**
* Gets the value of the 'category' field.
* category
* @return The value.
*/
public java.lang.String getCategory() {
return category;
}
/**
* Sets the value of the 'category' field.
* category
* @param value The value of 'category'.
* @return This builder.
*/
public net.lightapi.portal.covid.CovidEntityCreatedEvent.Builder setCategory(java.lang.String value) {
validate(fields()[4], value);
this.category = value;
fieldSetFlags()[4] = true;
return this;
}
/**
* Checks whether the 'category' field has been set.
* category
* @return True if the 'category' field has been set, false otherwise.
*/
public boolean hasCategory() {
return fieldSetFlags()[4];
}
/**
* Clears the value of the 'category' field.
* category
* @return This builder.
*/
public net.lightapi.portal.covid.CovidEntityCreatedEvent.Builder clearCategory() {
category = null;
fieldSetFlags()[4] = false;
return this;
}
/**
* Gets the value of the 'subcategory' field.
* subcategory
* @return The value.
*/
public java.lang.String getSubcategory() {
return subcategory;
}
/**
* Sets the value of the 'subcategory' field.
* subcategory
* @param value The value of 'subcategory'.
* @return This builder.
*/
public net.lightapi.portal.covid.CovidEntityCreatedEvent.Builder setSubcategory(java.lang.String value) {
validate(fields()[5], value);
this.subcategory = value;
fieldSetFlags()[5] = true;
return this;
}
/**
* Checks whether the 'subcategory' field has been set.
* subcategory
* @return True if the 'subcategory' field has been set, false otherwise.
*/
public boolean hasSubcategory() {
return fieldSetFlags()[5];
}
/**
* Clears the value of the 'subcategory' field.
* subcategory
* @return This builder.
*/
public net.lightapi.portal.covid.CovidEntityCreatedEvent.Builder clearSubcategory() {
subcategory = null;
fieldSetFlags()[5] = false;
return this;
}
/**
* Gets the value of the 'latitude' field.
* latitude
* @return The value.
*/
public double getLatitude() {
return latitude;
}
/**
* Sets the value of the 'latitude' field.
* latitude
* @param value The value of 'latitude'.
* @return This builder.
*/
public net.lightapi.portal.covid.CovidEntityCreatedEvent.Builder setLatitude(double value) {
validate(fields()[6], value);
this.latitude = value;
fieldSetFlags()[6] = true;
return this;
}
/**
* Checks whether the 'latitude' field has been set.
* latitude
* @return True if the 'latitude' field has been set, false otherwise.
*/
public boolean hasLatitude() {
return fieldSetFlags()[6];
}
/**
* Clears the value of the 'latitude' field.
* latitude
* @return This builder.
*/
public net.lightapi.portal.covid.CovidEntityCreatedEvent.Builder clearLatitude() {
fieldSetFlags()[6] = false;
return this;
}
/**
* Gets the value of the 'longitude' field.
* city longitude
* @return The value.
*/
public double getLongitude() {
return longitude;
}
/**
* Sets the value of the 'longitude' field.
* city longitude
* @param value The value of 'longitude'.
* @return This builder.
*/
public net.lightapi.portal.covid.CovidEntityCreatedEvent.Builder setLongitude(double value) {
validate(fields()[7], value);
this.longitude = value;
fieldSetFlags()[7] = true;
return this;
}
/**
* Checks whether the 'longitude' field has been set.
* city longitude
* @return True if the 'longitude' field has been set, false otherwise.
*/
public boolean hasLongitude() {
return fieldSetFlags()[7];
}
/**
* Clears the value of the 'longitude' field.
* city longitude
* @return This builder.
*/
public net.lightapi.portal.covid.CovidEntityCreatedEvent.Builder clearLongitude() {
fieldSetFlags()[7] = false;
return this;
}
/**
* Gets the value of the 'introduction' field.
* introduction
* @return The value.
*/
public java.lang.String getIntroduction() {
return introduction;
}
/**
* Sets the value of the 'introduction' field.
* introduction
* @param value The value of 'introduction'.
* @return This builder.
*/
public net.lightapi.portal.covid.CovidEntityCreatedEvent.Builder setIntroduction(java.lang.String value) {
validate(fields()[8], value);
this.introduction = value;
fieldSetFlags()[8] = true;
return this;
}
/**
* Checks whether the 'introduction' field has been set.
* introduction
* @return True if the 'introduction' field has been set, false otherwise.
*/
public boolean hasIntroduction() {
return fieldSetFlags()[8];
}
/**
* Clears the value of the 'introduction' field.
* introduction
* @return This builder.
*/
public net.lightapi.portal.covid.CovidEntityCreatedEvent.Builder clearIntroduction() {
introduction = null;
fieldSetFlags()[8] = false;
return this;
}
/**
* Gets the value of the 'timestamp' field.
* time the event is recorded
* @return The value.
*/
public long getTimestamp() {
return timestamp;
}
/**
* Sets the value of the 'timestamp' field.
* time the event is recorded
* @param value The value of 'timestamp'.
* @return This builder.
*/
public net.lightapi.portal.covid.CovidEntityCreatedEvent.Builder setTimestamp(long value) {
validate(fields()[9], value);
this.timestamp = value;
fieldSetFlags()[9] = true;
return this;
}
/**
* Checks whether the 'timestamp' field has been set.
* time the event is recorded
* @return True if the 'timestamp' field has been set, false otherwise.
*/
public boolean hasTimestamp() {
return fieldSetFlags()[9];
}
/**
* Clears the value of the 'timestamp' field.
* time the event is recorded
* @return This builder.
*/
public net.lightapi.portal.covid.CovidEntityCreatedEvent.Builder clearTimestamp() {
fieldSetFlags()[9] = false;
return this;
}
@Override
@SuppressWarnings("unchecked")
public CovidEntityCreatedEvent build() {
try {
CovidEntityCreatedEvent record = new CovidEntityCreatedEvent();
if (EventIdBuilder != null) {
try {
record.EventId = this.EventIdBuilder.build();
} catch (org.apache.avro.AvroMissingFieldException e) {
e.addParentField(record.getSchema().getField("EventId"));
throw e;
}
} else {
record.EventId = fieldSetFlags()[0] ? this.EventId : (com.networknt.kafka.common.EventId) defaultValue(fields()[0]);
}
record.key = fieldSetFlags()[1] ? this.key : (java.lang.String) defaultValue(fields()[1]);
record.keyId = fieldSetFlags()[2] ? this.keyId : (java.lang.Integer) defaultValue(fields()[2]);
record.userId = fieldSetFlags()[3] ? this.userId : (java.lang.String) defaultValue(fields()[3]);
record.category = fieldSetFlags()[4] ? this.category : (java.lang.String) defaultValue(fields()[4]);
record.subcategory = fieldSetFlags()[5] ? this.subcategory : (java.lang.String) defaultValue(fields()[5]);
record.latitude = fieldSetFlags()[6] ? this.latitude : (java.lang.Double) defaultValue(fields()[6]);
record.longitude = fieldSetFlags()[7] ? this.longitude : (java.lang.Double) defaultValue(fields()[7]);
record.introduction = fieldSetFlags()[8] ? this.introduction : (java.lang.String) defaultValue(fields()[8]);
record.timestamp = fieldSetFlags()[9] ? this.timestamp : (java.lang.Long) defaultValue(fields()[9]);
return record;
} catch (org.apache.avro.AvroMissingFieldException e) {
throw e;
} catch (java.lang.Exception e) {
throw new org.apache.avro.AvroRuntimeException(e);
}
}
}
@SuppressWarnings("unchecked")
private static final org.apache.avro.io.DatumWriter
WRITER$ = (org.apache.avro.io.DatumWriter)MODEL$.createDatumWriter(SCHEMA$);
@Override public void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException {
WRITER$.write(this, SpecificData.getEncoder(out));
}
@SuppressWarnings("unchecked")
private static final org.apache.avro.io.DatumReader
READER$ = (org.apache.avro.io.DatumReader)MODEL$.createDatumReader(SCHEMA$);
@Override public void readExternal(java.io.ObjectInput in)
throws java.io.IOException {
READER$.read(this, SpecificData.getDecoder(in));
}
@Override protected boolean hasCustomCoders() { return true; }
@Override public void customEncode(org.apache.avro.io.Encoder out)
throws java.io.IOException
{
this.EventId.customEncode(out);
out.writeString(this.key);
out.writeInt(this.keyId);
out.writeString(this.userId);
out.writeString(this.category);
out.writeString(this.subcategory);
out.writeDouble(this.latitude);
out.writeDouble(this.longitude);
out.writeString(this.introduction);
out.writeLong(this.timestamp);
}
@Override public void customDecode(org.apache.avro.io.ResolvingDecoder in)
throws java.io.IOException
{
org.apache.avro.Schema.Field[] fieldOrder = in.readFieldOrderIfDiff();
if (fieldOrder == null) {
if (this.EventId == null) {
this.EventId = new com.networknt.kafka.common.EventId();
}
this.EventId.customDecode(in);
this.key = in.readString();
this.keyId = in.readInt();
this.userId = in.readString();
this.category = in.readString();
this.subcategory = in.readString();
this.latitude = in.readDouble();
this.longitude = in.readDouble();
this.introduction = in.readString();
this.timestamp = in.readLong();
} else {
for (int i = 0; i < 10; i++) {
switch (fieldOrder[i].pos()) {
case 0:
if (this.EventId == null) {
this.EventId = new com.networknt.kafka.common.EventId();
}
this.EventId.customDecode(in);
break;
case 1:
this.key = in.readString();
break;
case 2:
this.keyId = in.readInt();
break;
case 3:
this.userId = in.readString();
break;
case 4:
this.category = in.readString();
break;
case 5:
this.subcategory = in.readString();
break;
case 6:
this.latitude = in.readDouble();
break;
case 7:
this.longitude = in.readDouble();
break;
case 8:
this.introduction = in.readString();
break;
case 9:
this.timestamp = in.readLong();
break;
default:
throw new java.io.IOException("Corrupt ResolvingDecoder.");
}
}
}
}
}