/** * Autogenerated by Avro * * DO NOT EDIT DIRECTLY */ package org.kaaproject.kaa.common.endpoint.gen; @SuppressWarnings("all") @org.apache.avro.specific.AvroGenerated public class BasicSystemNotification extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord { public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"BasicSystemNotification\",\"namespace\":\"org.kaaproject.kaa.common.endpoint.gen\",\"fields\":[{\"name\":\"notificationBody\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"systemNotificationParam1\",\"type\":\"int\"},{\"name\":\"systemNotificationParam2\",\"type\":\"int\"}]}"); private java.lang.String notificationBody; private int systemNotificationParam1; private int systemNotificationParam2; /** * Default constructor. Note that this does not initialize fields * to their default values from the schema. If that is desired then * one should use {@link \#newBuilder()}. */ public BasicSystemNotification() { } /** * All-args constructor. */ public BasicSystemNotification(java.lang.String notificationBody, java.lang.Integer systemNotificationParam1, java.lang.Integer systemNotificationParam2) { this.notificationBody = notificationBody; this.systemNotificationParam1 = systemNotificationParam1; this.systemNotificationParam2 = systemNotificationParam2; } public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } /** * Creates a new BasicSystemNotification RecordBuilder */ public static org.kaaproject.kaa.common.endpoint.gen.BasicSystemNotification.Builder newBuilder() { return new org.kaaproject.kaa.common.endpoint.gen.BasicSystemNotification.Builder(); } /** * Creates a new BasicSystemNotification RecordBuilder by copying an existing Builder */ public static org.kaaproject.kaa.common.endpoint.gen.BasicSystemNotification.Builder newBuilder(org.kaaproject.kaa.common.endpoint.gen.BasicSystemNotification.Builder other) { return new org.kaaproject.kaa.common.endpoint.gen.BasicSystemNotification.Builder(other); } /** * Creates a new BasicSystemNotification RecordBuilder by copying an existing * BasicSystemNotification instance */ public static org.kaaproject.kaa.common.endpoint.gen.BasicSystemNotification.Builder newBuilder(org.kaaproject.kaa.common.endpoint.gen.BasicSystemNotification other) { return new org.kaaproject.kaa.common.endpoint.gen.BasicSystemNotification.Builder(other); } 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 notificationBody; case 1: return systemNotificationParam1; case 2: return systemNotificationParam2; 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: notificationBody = (java.lang.String) value$; break; case 1: systemNotificationParam1 = (java.lang.Integer) value$; break; case 2: systemNotificationParam2 = (java.lang.Integer) value$; break; default: throw new org.apache.avro.AvroRuntimeException("Bad index"); } } /** * Gets the value of the 'notificationBody' field. */ public java.lang.String getNotificationBody() { return notificationBody; } /** * Sets the value of the 'notificationBody' field. * * @param value the value to set. */ public void setNotificationBody(java.lang.String value) { this.notificationBody = value; } /** * Gets the value of the 'systemNotificationParam1' field. */ public java.lang.Integer getSystemNotificationParam1() { return systemNotificationParam1; } /** * Sets the value of the 'systemNotificationParam1' field. * * @param value the value to set. */ public void setSystemNotificationParam1(java.lang.Integer value) { this.systemNotificationParam1 = value; } /** * Gets the value of the 'systemNotificationParam2' field. */ public java.lang.Integer getSystemNotificationParam2() { return systemNotificationParam2; } /** * Sets the value of the 'systemNotificationParam2' field. * * @param value the value to set. */ public void setSystemNotificationParam2(java.lang.Integer value) { this.systemNotificationParam2 = value; } /** * RecordBuilder for BasicSystemNotification instances. */ public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<BasicSystemNotification> implements org.apache.avro.data.RecordBuilder<BasicSystemNotification> { private java.lang.String notificationBody; private int systemNotificationParam1; private int systemNotificationParam2; /** * Creates a new Builder */ private Builder() { super(org.kaaproject.kaa.common.endpoint.gen.BasicSystemNotification.SCHEMA$); } /** * Creates a Builder by copying an existing Builder */ private Builder(org.kaaproject.kaa.common.endpoint.gen.BasicSystemNotification.Builder other) { super(other); if (isValidValue(fields()[0], other.notificationBody)) { this.notificationBody = data().deepCopy(fields()[0].schema(), other.notificationBody); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.systemNotificationParam1)) { this.systemNotificationParam1 = data().deepCopy(fields()[1].schema(), other.systemNotificationParam1); fieldSetFlags()[1] = true; } if (isValidValue(fields()[2], other.systemNotificationParam2)) { this.systemNotificationParam2 = data().deepCopy(fields()[2].schema(), other.systemNotificationParam2); fieldSetFlags()[2] = true; } } /** * Creates a Builder by copying an existing BasicSystemNotification instance */ private Builder(org.kaaproject.kaa.common.endpoint.gen.BasicSystemNotification other) { super(org.kaaproject.kaa.common.endpoint.gen.BasicSystemNotification.SCHEMA$); if (isValidValue(fields()[0], other.notificationBody)) { this.notificationBody = data().deepCopy(fields()[0].schema(), other.notificationBody); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.systemNotificationParam1)) { this.systemNotificationParam1 = data().deepCopy(fields()[1].schema(), other.systemNotificationParam1); fieldSetFlags()[1] = true; } if (isValidValue(fields()[2], other.systemNotificationParam2)) { this.systemNotificationParam2 = data().deepCopy(fields()[2].schema(), other.systemNotificationParam2); fieldSetFlags()[2] = true; } } /** * Gets the value of the 'notificationBody' field */ public java.lang.String getNotificationBody() { return notificationBody; } /** * Sets the value of the 'notificationBody' field */ public org.kaaproject.kaa.common.endpoint.gen.BasicSystemNotification.Builder setNotificationBody(java.lang.String value) { validate(fields()[0], value); this.notificationBody = value; fieldSetFlags()[0] = true; return this; } /** * Checks whether the 'notificationBody' field has been set */ public boolean hasNotificationBody() { return fieldSetFlags()[0]; } /** * Clears the value of the 'notificationBody' field */ public org.kaaproject.kaa.common.endpoint.gen.BasicSystemNotification.Builder clearNotificationBody() { notificationBody = null; fieldSetFlags()[0] = false; return this; } /** * Gets the value of the 'systemNotificationParam1' field */ public java.lang.Integer getSystemNotificationParam1() { return systemNotificationParam1; } /** * Sets the value of the 'systemNotificationParam1' field */ public org.kaaproject.kaa.common.endpoint.gen.BasicSystemNotification.Builder setSystemNotificationParam1(int value) { validate(fields()[1], value); this.systemNotificationParam1 = value; fieldSetFlags()[1] = true; return this; } /** * Checks whether the 'systemNotificationParam1' field has been set */ public boolean hasSystemNotificationParam1() { return fieldSetFlags()[1]; } /** * Clears the value of the 'systemNotificationParam1' field */ public org.kaaproject.kaa.common.endpoint.gen.BasicSystemNotification.Builder clearSystemNotificationParam1() { fieldSetFlags()[1] = false; return this; } /** * Gets the value of the 'systemNotificationParam2' field */ public java.lang.Integer getSystemNotificationParam2() { return systemNotificationParam2; } /** * Sets the value of the 'systemNotificationParam2' field */ public org.kaaproject.kaa.common.endpoint.gen.BasicSystemNotification.Builder setSystemNotificationParam2(int value) { validate(fields()[2], value); this.systemNotificationParam2 = value; fieldSetFlags()[2] = true; return this; } /** * Checks whether the 'systemNotificationParam2' field has been set */ public boolean hasSystemNotificationParam2() { return fieldSetFlags()[2]; } /** * Clears the value of the 'systemNotificationParam2' field */ public org.kaaproject.kaa.common.endpoint.gen.BasicSystemNotification.Builder clearSystemNotificationParam2() { fieldSetFlags()[2] = false; return this; } @Override public BasicSystemNotification build() { try { BasicSystemNotification record = new BasicSystemNotification(); record.notificationBody = fieldSetFlags()[0] ? this.notificationBody : (java.lang.String) defaultValue(fields()[0]); record.systemNotificationParam1 = fieldSetFlags()[1] ? this.systemNotificationParam1 : (java.lang.Integer) defaultValue(fields()[1]); record.systemNotificationParam2 = fieldSetFlags()[2] ? this.systemNotificationParam2 : (java.lang.Integer) defaultValue(fields()[2]); return record; } catch (Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } } }