net.lightapi.portal.market.RuleUpdatedEvent Maven / Gradle / Ivy
The newest version!
/**
* Autogenerated by Avro
*
* DO NOT EDIT DIRECTLY
*/
package net.lightapi.portal.market;
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 RuleUpdatedEvent extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {
private static final long serialVersionUID = -1957082621721269391L;
public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"RuleUpdatedEvent\",\"namespace\":\"net.lightapi.portal.market\",\"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\":\"keyId\",\"type\":\"int\",\"doc\":\"keyId 0 rule 1 host 2 service\"},{\"name\":\"host\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"doc\":\"host\"},{\"name\":\"ruleId\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"doc\":\"rule id\"},{\"name\":\"ruleType\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"doc\":\"rule type\"},{\"name\":\"groupId\",\"type\":[\"null\",{\"type\":\"string\",\"avro.java.string\":\"String\"}],\"doc\":\"group id\",\"default\":null},{\"name\":\"visibility\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"doc\":\"rule visibility\"},{\"name\":\"desc\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"doc\":\"rule description\"},{\"name\":\"value\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"doc\":\"rule detail in YAML\"},{\"name\":\"owner\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"doc\":\"rule owner id\"},{\"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 RuleUpdatedEvent 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 RuleUpdatedEvent from a ByteBuffer.
* @param b a byte buffer holding serialized data for an instance of this class
* @return a RuleUpdatedEvent 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 RuleUpdatedEvent fromByteBuffer(
java.nio.ByteBuffer b) throws java.io.IOException {
return DECODER.decode(b);
}
private com.networknt.kafka.common.EventId EventId;
/** keyId 0 rule 1 host 2 service */
private int keyId;
/** host */
private java.lang.String host;
/** rule id */
private java.lang.String ruleId;
/** rule type */
private java.lang.String ruleType;
/** group id */
private java.lang.String groupId;
/** rule visibility */
private java.lang.String visibility;
/** rule description */
private java.lang.String desc;
/** rule detail in YAML */
private java.lang.String value;
/** rule owner id */
private java.lang.String owner;
/** 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 RuleUpdatedEvent() {}
/**
* All-args constructor.
* @param EventId The new value for EventId
* @param keyId keyId 0 rule 1 host 2 service
* @param host host
* @param ruleId rule id
* @param ruleType rule type
* @param groupId group id
* @param visibility rule visibility
* @param desc rule description
* @param value rule detail in YAML
* @param owner rule owner id
* @param timestamp time the event is recorded
*/
public RuleUpdatedEvent(com.networknt.kafka.common.EventId EventId, java.lang.Integer keyId, java.lang.String host, java.lang.String ruleId, java.lang.String ruleType, java.lang.String groupId, java.lang.String visibility, java.lang.String desc, java.lang.String value, java.lang.String owner, java.lang.Long timestamp) {
this.EventId = EventId;
this.keyId = keyId;
this.host = host;
this.ruleId = ruleId;
this.ruleType = ruleType;
this.groupId = groupId;
this.visibility = visibility;
this.desc = desc;
this.value = value;
this.owner = owner;
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 keyId;
case 2: return host;
case 3: return ruleId;
case 4: return ruleType;
case 5: return groupId;
case 6: return visibility;
case 7: return desc;
case 8: return value;
case 9: return owner;
case 10: 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: keyId = (java.lang.Integer)value$; break;
case 2: host = value$ != null ? value$.toString() : null; break;
case 3: ruleId = value$ != null ? value$.toString() : null; break;
case 4: ruleType = value$ != null ? value$.toString() : null; break;
case 5: groupId = value$ != null ? value$.toString() : null; break;
case 6: visibility = value$ != null ? value$.toString() : null; break;
case 7: desc = value$ != null ? value$.toString() : null; break;
case 8: value = value$ != null ? value$.toString() : null; break;
case 9: owner = value$ != null ? value$.toString() : null; break;
case 10: 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 'keyId' field.
* @return keyId 0 rule 1 host 2 service
*/
public int getKeyId() {
return keyId;
}
/**
* Sets the value of the 'keyId' field.
* keyId 0 rule 1 host 2 service
* @param value the value to set.
*/
public void setKeyId(int value) {
this.keyId = value;
}
/**
* Gets the value of the 'host' field.
* @return host
*/
public java.lang.String getHost() {
return host;
}
/**
* Sets the value of the 'host' field.
* host
* @param value the value to set.
*/
public void setHost(java.lang.String value) {
this.host = value;
}
/**
* Gets the value of the 'ruleId' field.
* @return rule id
*/
public java.lang.String getRuleId() {
return ruleId;
}
/**
* Sets the value of the 'ruleId' field.
* rule id
* @param value the value to set.
*/
public void setRuleId(java.lang.String value) {
this.ruleId = value;
}
/**
* Gets the value of the 'ruleType' field.
* @return rule type
*/
public java.lang.String getRuleType() {
return ruleType;
}
/**
* Sets the value of the 'ruleType' field.
* rule type
* @param value the value to set.
*/
public void setRuleType(java.lang.String value) {
this.ruleType = value;
}
/**
* Gets the value of the 'groupId' field.
* @return group id
*/
public java.lang.String getGroupId() {
return groupId;
}
/**
* Sets the value of the 'groupId' field.
* group id
* @param value the value to set.
*/
public void setGroupId(java.lang.String value) {
this.groupId = value;
}
/**
* Gets the value of the 'visibility' field.
* @return rule visibility
*/
public java.lang.String getVisibility() {
return visibility;
}
/**
* Sets the value of the 'visibility' field.
* rule visibility
* @param value the value to set.
*/
public void setVisibility(java.lang.String value) {
this.visibility = value;
}
/**
* Gets the value of the 'desc' field.
* @return rule description
*/
public java.lang.String getDesc() {
return desc;
}
/**
* Sets the value of the 'desc' field.
* rule description
* @param value the value to set.
*/
public void setDesc(java.lang.String value) {
this.desc = value;
}
/**
* Gets the value of the 'value' field.
* @return rule detail in YAML
*/
public java.lang.String getValue() {
return value;
}
/**
* Sets the value of the 'value' field.
* rule detail in YAML
* @param value the value to set.
*/
public void setValue(java.lang.String value) {
this.value = value;
}
/**
* Gets the value of the 'owner' field.
* @return rule owner id
*/
public java.lang.String getOwner() {
return owner;
}
/**
* Sets the value of the 'owner' field.
* rule owner id
* @param value the value to set.
*/
public void setOwner(java.lang.String value) {
this.owner = 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 RuleUpdatedEvent RecordBuilder.
* @return A new RuleUpdatedEvent RecordBuilder
*/
public static net.lightapi.portal.market.RuleUpdatedEvent.Builder newBuilder() {
return new net.lightapi.portal.market.RuleUpdatedEvent.Builder();
}
/**
* Creates a new RuleUpdatedEvent RecordBuilder by copying an existing Builder.
* @param other The existing builder to copy.
* @return A new RuleUpdatedEvent RecordBuilder
*/
public static net.lightapi.portal.market.RuleUpdatedEvent.Builder newBuilder(net.lightapi.portal.market.RuleUpdatedEvent.Builder other) {
if (other == null) {
return new net.lightapi.portal.market.RuleUpdatedEvent.Builder();
} else {
return new net.lightapi.portal.market.RuleUpdatedEvent.Builder(other);
}
}
/**
* Creates a new RuleUpdatedEvent RecordBuilder by copying an existing RuleUpdatedEvent instance.
* @param other The existing instance to copy.
* @return A new RuleUpdatedEvent RecordBuilder
*/
public static net.lightapi.portal.market.RuleUpdatedEvent.Builder newBuilder(net.lightapi.portal.market.RuleUpdatedEvent other) {
if (other == null) {
return new net.lightapi.portal.market.RuleUpdatedEvent.Builder();
} else {
return new net.lightapi.portal.market.RuleUpdatedEvent.Builder(other);
}
}
/**
* RecordBuilder for RuleUpdatedEvent 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;
/** keyId 0 rule 1 host 2 service */
private int keyId;
/** host */
private java.lang.String host;
/** rule id */
private java.lang.String ruleId;
/** rule type */
private java.lang.String ruleType;
/** group id */
private java.lang.String groupId;
/** rule visibility */
private java.lang.String visibility;
/** rule description */
private java.lang.String desc;
/** rule detail in YAML */
private java.lang.String value;
/** rule owner id */
private java.lang.String owner;
/** 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.market.RuleUpdatedEvent.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.keyId)) {
this.keyId = data().deepCopy(fields()[1].schema(), other.keyId);
fieldSetFlags()[1] = other.fieldSetFlags()[1];
}
if (isValidValue(fields()[2], other.host)) {
this.host = data().deepCopy(fields()[2].schema(), other.host);
fieldSetFlags()[2] = other.fieldSetFlags()[2];
}
if (isValidValue(fields()[3], other.ruleId)) {
this.ruleId = data().deepCopy(fields()[3].schema(), other.ruleId);
fieldSetFlags()[3] = other.fieldSetFlags()[3];
}
if (isValidValue(fields()[4], other.ruleType)) {
this.ruleType = data().deepCopy(fields()[4].schema(), other.ruleType);
fieldSetFlags()[4] = other.fieldSetFlags()[4];
}
if (isValidValue(fields()[5], other.groupId)) {
this.groupId = data().deepCopy(fields()[5].schema(), other.groupId);
fieldSetFlags()[5] = other.fieldSetFlags()[5];
}
if (isValidValue(fields()[6], other.visibility)) {
this.visibility = data().deepCopy(fields()[6].schema(), other.visibility);
fieldSetFlags()[6] = other.fieldSetFlags()[6];
}
if (isValidValue(fields()[7], other.desc)) {
this.desc = data().deepCopy(fields()[7].schema(), other.desc);
fieldSetFlags()[7] = other.fieldSetFlags()[7];
}
if (isValidValue(fields()[8], other.value)) {
this.value = data().deepCopy(fields()[8].schema(), other.value);
fieldSetFlags()[8] = other.fieldSetFlags()[8];
}
if (isValidValue(fields()[9], other.owner)) {
this.owner = data().deepCopy(fields()[9].schema(), other.owner);
fieldSetFlags()[9] = other.fieldSetFlags()[9];
}
if (isValidValue(fields()[10], other.timestamp)) {
this.timestamp = data().deepCopy(fields()[10].schema(), other.timestamp);
fieldSetFlags()[10] = other.fieldSetFlags()[10];
}
}
/**
* Creates a Builder by copying an existing RuleUpdatedEvent instance
* @param other The existing instance to copy.
*/
private Builder(net.lightapi.portal.market.RuleUpdatedEvent 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.keyId)) {
this.keyId = data().deepCopy(fields()[1].schema(), other.keyId);
fieldSetFlags()[1] = true;
}
if (isValidValue(fields()[2], other.host)) {
this.host = data().deepCopy(fields()[2].schema(), other.host);
fieldSetFlags()[2] = true;
}
if (isValidValue(fields()[3], other.ruleId)) {
this.ruleId = data().deepCopy(fields()[3].schema(), other.ruleId);
fieldSetFlags()[3] = true;
}
if (isValidValue(fields()[4], other.ruleType)) {
this.ruleType = data().deepCopy(fields()[4].schema(), other.ruleType);
fieldSetFlags()[4] = true;
}
if (isValidValue(fields()[5], other.groupId)) {
this.groupId = data().deepCopy(fields()[5].schema(), other.groupId);
fieldSetFlags()[5] = true;
}
if (isValidValue(fields()[6], other.visibility)) {
this.visibility = data().deepCopy(fields()[6].schema(), other.visibility);
fieldSetFlags()[6] = true;
}
if (isValidValue(fields()[7], other.desc)) {
this.desc = data().deepCopy(fields()[7].schema(), other.desc);
fieldSetFlags()[7] = true;
}
if (isValidValue(fields()[8], other.value)) {
this.value = data().deepCopy(fields()[8].schema(), other.value);
fieldSetFlags()[8] = true;
}
if (isValidValue(fields()[9], other.owner)) {
this.owner = data().deepCopy(fields()[9].schema(), other.owner);
fieldSetFlags()[9] = true;
}
if (isValidValue(fields()[10], other.timestamp)) {
this.timestamp = data().deepCopy(fields()[10].schema(), other.timestamp);
fieldSetFlags()[10] = 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.market.RuleUpdatedEvent.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.market.RuleUpdatedEvent.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.market.RuleUpdatedEvent.Builder clearEventId() {
EventId = null;
EventIdBuilder = null;
fieldSetFlags()[0] = false;
return this;
}
/**
* Gets the value of the 'keyId' field.
* keyId 0 rule 1 host 2 service
* @return The value.
*/
public int getKeyId() {
return keyId;
}
/**
* Sets the value of the 'keyId' field.
* keyId 0 rule 1 host 2 service
* @param value The value of 'keyId'.
* @return This builder.
*/
public net.lightapi.portal.market.RuleUpdatedEvent.Builder setKeyId(int value) {
validate(fields()[1], value);
this.keyId = value;
fieldSetFlags()[1] = true;
return this;
}
/**
* Checks whether the 'keyId' field has been set.
* keyId 0 rule 1 host 2 service
* @return True if the 'keyId' field has been set, false otherwise.
*/
public boolean hasKeyId() {
return fieldSetFlags()[1];
}
/**
* Clears the value of the 'keyId' field.
* keyId 0 rule 1 host 2 service
* @return This builder.
*/
public net.lightapi.portal.market.RuleUpdatedEvent.Builder clearKeyId() {
fieldSetFlags()[1] = false;
return this;
}
/**
* Gets the value of the 'host' field.
* host
* @return The value.
*/
public java.lang.String getHost() {
return host;
}
/**
* Sets the value of the 'host' field.
* host
* @param value The value of 'host'.
* @return This builder.
*/
public net.lightapi.portal.market.RuleUpdatedEvent.Builder setHost(java.lang.String value) {
validate(fields()[2], value);
this.host = value;
fieldSetFlags()[2] = true;
return this;
}
/**
* Checks whether the 'host' field has been set.
* host
* @return True if the 'host' field has been set, false otherwise.
*/
public boolean hasHost() {
return fieldSetFlags()[2];
}
/**
* Clears the value of the 'host' field.
* host
* @return This builder.
*/
public net.lightapi.portal.market.RuleUpdatedEvent.Builder clearHost() {
host = null;
fieldSetFlags()[2] = false;
return this;
}
/**
* Gets the value of the 'ruleId' field.
* rule id
* @return The value.
*/
public java.lang.String getRuleId() {
return ruleId;
}
/**
* Sets the value of the 'ruleId' field.
* rule id
* @param value The value of 'ruleId'.
* @return This builder.
*/
public net.lightapi.portal.market.RuleUpdatedEvent.Builder setRuleId(java.lang.String value) {
validate(fields()[3], value);
this.ruleId = value;
fieldSetFlags()[3] = true;
return this;
}
/**
* Checks whether the 'ruleId' field has been set.
* rule id
* @return True if the 'ruleId' field has been set, false otherwise.
*/
public boolean hasRuleId() {
return fieldSetFlags()[3];
}
/**
* Clears the value of the 'ruleId' field.
* rule id
* @return This builder.
*/
public net.lightapi.portal.market.RuleUpdatedEvent.Builder clearRuleId() {
ruleId = null;
fieldSetFlags()[3] = false;
return this;
}
/**
* Gets the value of the 'ruleType' field.
* rule type
* @return The value.
*/
public java.lang.String getRuleType() {
return ruleType;
}
/**
* Sets the value of the 'ruleType' field.
* rule type
* @param value The value of 'ruleType'.
* @return This builder.
*/
public net.lightapi.portal.market.RuleUpdatedEvent.Builder setRuleType(java.lang.String value) {
validate(fields()[4], value);
this.ruleType = value;
fieldSetFlags()[4] = true;
return this;
}
/**
* Checks whether the 'ruleType' field has been set.
* rule type
* @return True if the 'ruleType' field has been set, false otherwise.
*/
public boolean hasRuleType() {
return fieldSetFlags()[4];
}
/**
* Clears the value of the 'ruleType' field.
* rule type
* @return This builder.
*/
public net.lightapi.portal.market.RuleUpdatedEvent.Builder clearRuleType() {
ruleType = null;
fieldSetFlags()[4] = false;
return this;
}
/**
* Gets the value of the 'groupId' field.
* group id
* @return The value.
*/
public java.lang.String getGroupId() {
return groupId;
}
/**
* Sets the value of the 'groupId' field.
* group id
* @param value The value of 'groupId'.
* @return This builder.
*/
public net.lightapi.portal.market.RuleUpdatedEvent.Builder setGroupId(java.lang.String value) {
validate(fields()[5], value);
this.groupId = value;
fieldSetFlags()[5] = true;
return this;
}
/**
* Checks whether the 'groupId' field has been set.
* group id
* @return True if the 'groupId' field has been set, false otherwise.
*/
public boolean hasGroupId() {
return fieldSetFlags()[5];
}
/**
* Clears the value of the 'groupId' field.
* group id
* @return This builder.
*/
public net.lightapi.portal.market.RuleUpdatedEvent.Builder clearGroupId() {
groupId = null;
fieldSetFlags()[5] = false;
return this;
}
/**
* Gets the value of the 'visibility' field.
* rule visibility
* @return The value.
*/
public java.lang.String getVisibility() {
return visibility;
}
/**
* Sets the value of the 'visibility' field.
* rule visibility
* @param value The value of 'visibility'.
* @return This builder.
*/
public net.lightapi.portal.market.RuleUpdatedEvent.Builder setVisibility(java.lang.String value) {
validate(fields()[6], value);
this.visibility = value;
fieldSetFlags()[6] = true;
return this;
}
/**
* Checks whether the 'visibility' field has been set.
* rule visibility
* @return True if the 'visibility' field has been set, false otherwise.
*/
public boolean hasVisibility() {
return fieldSetFlags()[6];
}
/**
* Clears the value of the 'visibility' field.
* rule visibility
* @return This builder.
*/
public net.lightapi.portal.market.RuleUpdatedEvent.Builder clearVisibility() {
visibility = null;
fieldSetFlags()[6] = false;
return this;
}
/**
* Gets the value of the 'desc' field.
* rule description
* @return The value.
*/
public java.lang.String getDesc() {
return desc;
}
/**
* Sets the value of the 'desc' field.
* rule description
* @param value The value of 'desc'.
* @return This builder.
*/
public net.lightapi.portal.market.RuleUpdatedEvent.Builder setDesc(java.lang.String value) {
validate(fields()[7], value);
this.desc = value;
fieldSetFlags()[7] = true;
return this;
}
/**
* Checks whether the 'desc' field has been set.
* rule description
* @return True if the 'desc' field has been set, false otherwise.
*/
public boolean hasDesc() {
return fieldSetFlags()[7];
}
/**
* Clears the value of the 'desc' field.
* rule description
* @return This builder.
*/
public net.lightapi.portal.market.RuleUpdatedEvent.Builder clearDesc() {
desc = null;
fieldSetFlags()[7] = false;
return this;
}
/**
* Gets the value of the 'value' field.
* rule detail in YAML
* @return The value.
*/
public java.lang.String getValue() {
return value;
}
/**
* Sets the value of the 'value' field.
* rule detail in YAML
* @param value The value of 'value'.
* @return This builder.
*/
public net.lightapi.portal.market.RuleUpdatedEvent.Builder setValue(java.lang.String value) {
validate(fields()[8], value);
this.value = value;
fieldSetFlags()[8] = true;
return this;
}
/**
* Checks whether the 'value' field has been set.
* rule detail in YAML
* @return True if the 'value' field has been set, false otherwise.
*/
public boolean hasValue() {
return fieldSetFlags()[8];
}
/**
* Clears the value of the 'value' field.
* rule detail in YAML
* @return This builder.
*/
public net.lightapi.portal.market.RuleUpdatedEvent.Builder clearValue() {
value = null;
fieldSetFlags()[8] = false;
return this;
}
/**
* Gets the value of the 'owner' field.
* rule owner id
* @return The value.
*/
public java.lang.String getOwner() {
return owner;
}
/**
* Sets the value of the 'owner' field.
* rule owner id
* @param value The value of 'owner'.
* @return This builder.
*/
public net.lightapi.portal.market.RuleUpdatedEvent.Builder setOwner(java.lang.String value) {
validate(fields()[9], value);
this.owner = value;
fieldSetFlags()[9] = true;
return this;
}
/**
* Checks whether the 'owner' field has been set.
* rule owner id
* @return True if the 'owner' field has been set, false otherwise.
*/
public boolean hasOwner() {
return fieldSetFlags()[9];
}
/**
* Clears the value of the 'owner' field.
* rule owner id
* @return This builder.
*/
public net.lightapi.portal.market.RuleUpdatedEvent.Builder clearOwner() {
owner = null;
fieldSetFlags()[9] = 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.market.RuleUpdatedEvent.Builder setTimestamp(long value) {
validate(fields()[10], value);
this.timestamp = value;
fieldSetFlags()[10] = 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()[10];
}
/**
* Clears the value of the 'timestamp' field.
* time the event is recorded
* @return This builder.
*/
public net.lightapi.portal.market.RuleUpdatedEvent.Builder clearTimestamp() {
fieldSetFlags()[10] = false;
return this;
}
@Override
@SuppressWarnings("unchecked")
public RuleUpdatedEvent build() {
try {
RuleUpdatedEvent record = new RuleUpdatedEvent();
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.keyId = fieldSetFlags()[1] ? this.keyId : (java.lang.Integer) defaultValue(fields()[1]);
record.host = fieldSetFlags()[2] ? this.host : (java.lang.String) defaultValue(fields()[2]);
record.ruleId = fieldSetFlags()[3] ? this.ruleId : (java.lang.String) defaultValue(fields()[3]);
record.ruleType = fieldSetFlags()[4] ? this.ruleType : (java.lang.String) defaultValue(fields()[4]);
record.groupId = fieldSetFlags()[5] ? this.groupId : (java.lang.String) defaultValue(fields()[5]);
record.visibility = fieldSetFlags()[6] ? this.visibility : (java.lang.String) defaultValue(fields()[6]);
record.desc = fieldSetFlags()[7] ? this.desc : (java.lang.String) defaultValue(fields()[7]);
record.value = fieldSetFlags()[8] ? this.value : (java.lang.String) defaultValue(fields()[8]);
record.owner = fieldSetFlags()[9] ? this.owner : (java.lang.String) defaultValue(fields()[9]);
record.timestamp = fieldSetFlags()[10] ? this.timestamp : (java.lang.Long) defaultValue(fields()[10]);
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.writeInt(this.keyId);
out.writeString(this.host);
out.writeString(this.ruleId);
out.writeString(this.ruleType);
if (this.groupId == null) {
out.writeIndex(0);
out.writeNull();
} else {
out.writeIndex(1);
out.writeString(this.groupId);
}
out.writeString(this.visibility);
out.writeString(this.desc);
out.writeString(this.value);
out.writeString(this.owner);
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.keyId = in.readInt();
this.host = in.readString();
this.ruleId = in.readString();
this.ruleType = in.readString();
if (in.readIndex() != 1) {
in.readNull();
this.groupId = null;
} else {
this.groupId = in.readString();
}
this.visibility = in.readString();
this.desc = in.readString();
this.value = in.readString();
this.owner = in.readString();
this.timestamp = in.readLong();
} else {
for (int i = 0; i < 11; 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.keyId = in.readInt();
break;
case 2:
this.host = in.readString();
break;
case 3:
this.ruleId = in.readString();
break;
case 4:
this.ruleType = in.readString();
break;
case 5:
if (in.readIndex() != 1) {
in.readNull();
this.groupId = null;
} else {
this.groupId = in.readString();
}
break;
case 6:
this.visibility = in.readString();
break;
case 7:
this.desc = in.readString();
break;
case 8:
this.value = in.readString();
break;
case 9:
this.owner = in.readString();
break;
case 10:
this.timestamp = in.readLong();
break;
default:
throw new java.io.IOException("Corrupt ResolvingDecoder.");
}
}
}
}
}