/** Creates a Builder by copying an existing Builder */ private Builder(org.kaaproject.kaa.common.endpoint.gen.ProtocolVersionPair.Builder other) { super(other); if (isValidValue(fields()[0], other.id)) { this.id = data().deepCopy(fields()[0].schema(), other.id); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.version)) { this.version = data().deepCopy(fields()[1].schema(), other.version); fieldSetFlags()[1] = true; } }
/** Creates a Builder by copying an existing ProtocolVersionPair instance */ private Builder(org.kaaproject.kaa.common.endpoint.gen.ProtocolVersionPair other) { super(org.kaaproject.kaa.common.endpoint.gen.ProtocolVersionPair.SCHEMA$); if (isValidValue(fields()[0], other.id)) { this.id = data().deepCopy(fields()[0].schema(), other.id); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.version)) { this.version = data().deepCopy(fields()[1].schema(), other.version); fieldSetFlags()[1] = true; } }
@Override public ProtocolVersionPair build() { try { ProtocolVersionPair record = new ProtocolVersionPair(); record.id = fieldSetFlags()[0] ? this.id : (java.lang.Integer) defaultValue(fields()[0]); record.version = fieldSetFlags()[1] ? this.version : (java.lang.Integer) defaultValue(fields()[1]); return record; } catch (Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } }
/** Checks whether the 'version' field has been set */ public boolean hasVersion() { return fieldSetFlags()[1]; }
/** Checks whether the 'id' field has been set */ public boolean hasId() { return fieldSetFlags()[0]; }
/** Sets the value of the 'version' field */ public org.kaaproject.kaa.common.endpoint.gen.ProtocolVersionPair.Builder setVersion(int value) { validate(fields()[1], value); this.version = value; fieldSetFlags()[1] = true; return this; }
/** Clears the value of the 'id' field */ public org.kaaproject.kaa.common.endpoint.gen.ProtocolVersionPair.Builder clearId() { fieldSetFlags()[0] = false; return this; }
/** Clears the value of the 'version' field */ public org.kaaproject.kaa.common.endpoint.gen.ProtocolVersionPair.Builder clearVersion() { fieldSetFlags()[1] = false; return this; }
/** Sets the value of the 'id' field */ public org.kaaproject.kaa.common.endpoint.gen.ProtocolVersionPair.Builder setId(int value) { validate(fields()[0], value); this.id = value; fieldSetFlags()[0] = true; return this; }