/** Creates a Builder by copying an existing Notification instance */ private Builder(org.kaaproject.kaa.common.endpoint.gen.Notification other) { super(org.kaaproject.kaa.common.endpoint.gen.Notification.SCHEMA$); if (isValidValue(fields()[0], other.topicId)) { this.topicId = data().deepCopy(fields()[0].schema(), other.topicId); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.type)) { this.type = data().deepCopy(fields()[1].schema(), other.type); fieldSetFlags()[1] = true; } if (isValidValue(fields()[2], other.uid)) { this.uid = data().deepCopy(fields()[2].schema(), other.uid); fieldSetFlags()[2] = true; } if (isValidValue(fields()[3], other.seqNumber)) { this.seqNumber = data().deepCopy(fields()[3].schema(), other.seqNumber); fieldSetFlags()[3] = true; } if (isValidValue(fields()[4], other.body)) { this.body = data().deepCopy(fields()[4].schema(), other.body); fieldSetFlags()[4] = true; } }
/** Creates a Builder by copying an existing Builder */ private Builder(org.kaaproject.kaa.common.endpoint.gen.Notification.Builder other) { super(other); if (isValidValue(fields()[0], other.topicId)) { this.topicId = data().deepCopy(fields()[0].schema(), other.topicId); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.type)) { this.type = data().deepCopy(fields()[1].schema(), other.type); fieldSetFlags()[1] = true; } if (isValidValue(fields()[2], other.uid)) { this.uid = data().deepCopy(fields()[2].schema(), other.uid); fieldSetFlags()[2] = true; } if (isValidValue(fields()[3], other.seqNumber)) { this.seqNumber = data().deepCopy(fields()[3].schema(), other.seqNumber); fieldSetFlags()[3] = true; } if (isValidValue(fields()[4], other.body)) { this.body = data().deepCopy(fields()[4].schema(), other.body); fieldSetFlags()[4] = true; } }
@Override public Notification build() { try { Notification record = new Notification(); record.topicId = fieldSetFlags()[0] ? this.topicId : (java.lang.Long) defaultValue(fields()[0]); record.type = fieldSetFlags()[1] ? this.type : (org.kaaproject.kaa.common.endpoint.gen.NotificationType) defaultValue(fields()[1]); record.uid = fieldSetFlags()[2] ? this.uid : (java.lang.String) defaultValue(fields()[2]); record.seqNumber = fieldSetFlags()[3] ? this.seqNumber : (java.lang.Integer) defaultValue(fields()[3]); record.body = fieldSetFlags()[4] ? this.body : (java.nio.ByteBuffer) defaultValue(fields()[4]); return record; } catch (Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } }
/** Sets the value of the 'body' field */ public org.kaaproject.kaa.common.endpoint.gen.Notification.Builder setBody(java.nio.ByteBuffer value) { validate(fields()[4], value); this.body = value; fieldSetFlags()[4] = true; return this; }
/** Sets the value of the 'seqNumber' field */ public org.kaaproject.kaa.common.endpoint.gen.Notification.Builder setSeqNumber(java.lang.Integer value) { validate(fields()[3], value); this.seqNumber = value; fieldSetFlags()[3] = true; return this; }
/** Sets the value of the 'type' field */ public org.kaaproject.kaa.common.endpoint.gen.Notification.Builder setType(org.kaaproject.kaa.common.endpoint.gen.NotificationType value) { validate(fields()[1], value); this.type = value; fieldSetFlags()[1] = true; return this; }
/** Sets the value of the 'uid' field */ public org.kaaproject.kaa.common.endpoint.gen.Notification.Builder setUid(java.lang.String value) { validate(fields()[2], value); this.uid = value; fieldSetFlags()[2] = true; return this; }
/** Sets the value of the 'topicId' field */ public org.kaaproject.kaa.common.endpoint.gen.Notification.Builder setTopicId(long value) { validate(fields()[0], value); this.topicId = value; fieldSetFlags()[0] = true; return this; }