/** Creates a Builder by copying an existing ProtocolMetaData instance */ private Builder(org.kaaproject.kaa.common.endpoint.gen.ProtocolMetaData other) { super(org.kaaproject.kaa.common.endpoint.gen.ProtocolMetaData.SCHEMA$); if (isValidValue(fields()[0], other.accessPointId)) { this.accessPointId = data().deepCopy(fields()[0].schema(), other.accessPointId); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.protocolVersionInfo)) { this.protocolVersionInfo = data().deepCopy(fields()[1].schema(), other.protocolVersionInfo); fieldSetFlags()[1] = true; } if (isValidValue(fields()[2], other.connectionInfo)) { this.connectionInfo = data().deepCopy(fields()[2].schema(), other.connectionInfo); fieldSetFlags()[2] = true; } }
/** Creates a Builder by copying an existing Builder */ private Builder(org.kaaproject.kaa.common.endpoint.gen.ProtocolMetaData.Builder other) { super(other); if (isValidValue(fields()[0], other.accessPointId)) { this.accessPointId = data().deepCopy(fields()[0].schema(), other.accessPointId); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.protocolVersionInfo)) { this.protocolVersionInfo = data().deepCopy(fields()[1].schema(), other.protocolVersionInfo); fieldSetFlags()[1] = true; } if (isValidValue(fields()[2], other.connectionInfo)) { this.connectionInfo = data().deepCopy(fields()[2].schema(), other.connectionInfo); fieldSetFlags()[2] = true; } }
@Override public ProtocolMetaData build() { try { ProtocolMetaData record = new ProtocolMetaData(); record.accessPointId = fieldSetFlags()[0] ? this.accessPointId : (java.lang.Integer) defaultValue(fields()[0]); record.protocolVersionInfo = fieldSetFlags()[1] ? this.protocolVersionInfo : (org.kaaproject.kaa.common.endpoint.gen.ProtocolVersionPair) defaultValue(fields()[1]); record.connectionInfo = fieldSetFlags()[2] ? this.connectionInfo : (java.nio.ByteBuffer) defaultValue(fields()[2]); return record; } catch (Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } }
/** Checks whether the 'connectionInfo' field has been set */ public boolean hasConnectionInfo() { return fieldSetFlags()[2]; }
/** Checks whether the 'protocolVersionInfo' field has been set */ public boolean hasProtocolVersionInfo() { return fieldSetFlags()[1]; }
/** Checks whether the 'accessPointId' field has been set */ public boolean hasAccessPointId() { return fieldSetFlags()[0]; }
/** Sets the value of the 'connectionInfo' field */ public org.kaaproject.kaa.common.endpoint.gen.ProtocolMetaData.Builder setConnectionInfo(java.nio.ByteBuffer value) { validate(fields()[2], value); this.connectionInfo = value; fieldSetFlags()[2] = true; return this; }
/** Sets the value of the 'accessPointId' field */ public org.kaaproject.kaa.common.endpoint.gen.ProtocolMetaData.Builder setAccessPointId(int value) { validate(fields()[0], value); this.accessPointId = value; fieldSetFlags()[0] = true; return this; }
/** Clears the value of the 'protocolVersionInfo' field */ public org.kaaproject.kaa.common.endpoint.gen.ProtocolMetaData.Builder clearProtocolVersionInfo() { protocolVersionInfo = null; fieldSetFlags()[1] = false; return this; }
/** Sets the value of the 'protocolVersionInfo' field */ public org.kaaproject.kaa.common.endpoint.gen.ProtocolMetaData.Builder setProtocolVersionInfo(org.kaaproject.kaa.common.endpoint.gen.ProtocolVersionPair value) { validate(fields()[1], value); this.protocolVersionInfo = value; fieldSetFlags()[1] = true; return this; }
/** Clears the value of the 'accessPointId' field */ public org.kaaproject.kaa.common.endpoint.gen.ProtocolMetaData.Builder clearAccessPointId() { fieldSetFlags()[0] = false; return this; }
/** Clears the value of the 'connectionInfo' field */ public org.kaaproject.kaa.common.endpoint.gen.ProtocolMetaData.Builder clearConnectionInfo() { connectionInfo = null; fieldSetFlags()[2] = false; return this; }