/** Creates a Builder by copying an existing UserSyncResponse instance */ private Builder(org.kaaproject.kaa.common.endpoint.gen.UserSyncResponse other) { super(org.kaaproject.kaa.common.endpoint.gen.UserSyncResponse.SCHEMA$); if (isValidValue(fields()[0], other.userAttachResponse)) { this.userAttachResponse = data().deepCopy(fields()[0].schema(), other.userAttachResponse); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.userAttachNotification)) { this.userAttachNotification = data().deepCopy(fields()[1].schema(), other.userAttachNotification); fieldSetFlags()[1] = true; } if (isValidValue(fields()[2], other.userDetachNotification)) { this.userDetachNotification = data().deepCopy(fields()[2].schema(), other.userDetachNotification); fieldSetFlags()[2] = true; } if (isValidValue(fields()[3], other.endpointAttachResponses)) { this.endpointAttachResponses = data().deepCopy(fields()[3].schema(), other.endpointAttachResponses); fieldSetFlags()[3] = true; } if (isValidValue(fields()[4], other.endpointDetachResponses)) { this.endpointDetachResponses = data().deepCopy(fields()[4].schema(), other.endpointDetachResponses); fieldSetFlags()[4] = true; } }
/** Creates a Builder by copying an existing Builder */ private Builder(org.kaaproject.kaa.common.endpoint.gen.UserSyncResponse.Builder other) { super(other); if (isValidValue(fields()[0], other.userAttachResponse)) { this.userAttachResponse = data().deepCopy(fields()[0].schema(), other.userAttachResponse); fieldSetFlags()[0] = true; } if (isValidValue(fields()[1], other.userAttachNotification)) { this.userAttachNotification = data().deepCopy(fields()[1].schema(), other.userAttachNotification); fieldSetFlags()[1] = true; } if (isValidValue(fields()[2], other.userDetachNotification)) { this.userDetachNotification = data().deepCopy(fields()[2].schema(), other.userDetachNotification); fieldSetFlags()[2] = true; } if (isValidValue(fields()[3], other.endpointAttachResponses)) { this.endpointAttachResponses = data().deepCopy(fields()[3].schema(), other.endpointAttachResponses); fieldSetFlags()[3] = true; } if (isValidValue(fields()[4], other.endpointDetachResponses)) { this.endpointDetachResponses = data().deepCopy(fields()[4].schema(), other.endpointDetachResponses); fieldSetFlags()[4] = true; } }
@Override public UserSyncResponse build() { try { UserSyncResponse record = new UserSyncResponse(); record.userAttachResponse = fieldSetFlags()[0] ? this.userAttachResponse : (org.kaaproject.kaa.common.endpoint.gen.UserAttachResponse) defaultValue(fields()[0]); record.userAttachNotification = fieldSetFlags()[1] ? this.userAttachNotification : (org.kaaproject.kaa.common.endpoint.gen.UserAttachNotification) defaultValue(fields()[1]); record.userDetachNotification = fieldSetFlags()[2] ? this.userDetachNotification : (org.kaaproject.kaa.common.endpoint.gen.UserDetachNotification) defaultValue(fields()[2]); record.endpointAttachResponses = fieldSetFlags()[3] ? this.endpointAttachResponses : (java.util.List<org.kaaproject.kaa.common.endpoint.gen.EndpointAttachResponse>) defaultValue(fields()[3]); record.endpointDetachResponses = fieldSetFlags()[4] ? this.endpointDetachResponses : (java.util.List<org.kaaproject.kaa.common.endpoint.gen.EndpointDetachResponse>) defaultValue(fields()[4]); return record; } catch (Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } }
/** Sets the value of the 'endpointAttachResponses' field */ public org.kaaproject.kaa.common.endpoint.gen.UserSyncResponse.Builder setEndpointAttachResponses(java.util.List<org.kaaproject.kaa.common.endpoint.gen.EndpointAttachResponse> value) { validate(fields()[3], value); this.endpointAttachResponses = value; fieldSetFlags()[3] = true; return this; }
/** Sets the value of the 'userDetachNotification' field */ public org.kaaproject.kaa.common.endpoint.gen.UserSyncResponse.Builder setUserDetachNotification(org.kaaproject.kaa.common.endpoint.gen.UserDetachNotification value) { validate(fields()[2], value); this.userDetachNotification = value; fieldSetFlags()[2] = true; return this; }
/** Sets the value of the 'endpointDetachResponses' field */ public org.kaaproject.kaa.common.endpoint.gen.UserSyncResponse.Builder setEndpointDetachResponses(java.util.List<org.kaaproject.kaa.common.endpoint.gen.EndpointDetachResponse> value) { validate(fields()[4], value); this.endpointDetachResponses = value; fieldSetFlags()[4] = true; return this; }
/** Sets the value of the 'userAttachNotification' field */ public org.kaaproject.kaa.common.endpoint.gen.UserSyncResponse.Builder setUserAttachNotification(org.kaaproject.kaa.common.endpoint.gen.UserAttachNotification value) { validate(fields()[1], value); this.userAttachNotification = value; fieldSetFlags()[1] = true; return this; }
/** Sets the value of the 'userAttachResponse' field */ public org.kaaproject.kaa.common.endpoint.gen.UserSyncResponse.Builder setUserAttachResponse(org.kaaproject.kaa.common.endpoint.gen.UserAttachResponse value) { validate(fields()[0], value); this.userAttachResponse = value; fieldSetFlags()[0] = true; return this; }