/** Creates a Builder by copying an existing Builder */ private Builder(org.kaaproject.kaa.common.endpoint.gen.SubscriptionCommand.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.command)) { this.command = data().deepCopy(fields()[1].schema(), other.command); fieldSetFlags()[1] = true; } }
/** Creates a Builder by copying an existing SubscriptionCommand instance */ private Builder(org.kaaproject.kaa.common.endpoint.gen.SubscriptionCommand other) { super(org.kaaproject.kaa.common.endpoint.gen.SubscriptionCommand.SCHEMA$); if (isValidValue(fields()[0], other.topicId)) { this.topicId = data().deepCopy(fields()[0].schema(), other.topicId); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.command)) { this.command = data().deepCopy(fields()[1].schema(), other.command); fieldSetFlags()[1] = true; } }
@Override public SubscriptionCommand build() { try { SubscriptionCommand record = new SubscriptionCommand(); record.topicId = fieldSetFlags()[0] ? this.topicId : (java.lang.Long) defaultValue(fields()[0]); record.command = fieldSetFlags()[1] ? this.command : (org.kaaproject.kaa.common.endpoint.gen.SubscriptionCommandType) defaultValue(fields()[1]); return record; } catch (Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } }
/** Sets the value of the 'command' field */ public org.kaaproject.kaa.common.endpoint.gen.SubscriptionCommand.Builder setCommand(org.kaaproject.kaa.common.endpoint.gen.SubscriptionCommandType value) { validate(fields()[1], value); this.command = value; fieldSetFlags()[1] = true; return this; }
/** Sets the value of the 'topicId' field */ public org.kaaproject.kaa.common.endpoint.gen.SubscriptionCommand.Builder setTopicId(long value) { validate(fields()[0], value); this.topicId = value; fieldSetFlags()[0] = true; return this; }