/** * Creates a Builder by copying an existing Producer instance * @param other The existing instance to copy. */ private Builder(com.homeaway.digitalplatform.streamregistry.Producer other) { super(SCHEMA$); if (isValidValue(fields()[0], other.actor)) { this.actor = data().deepCopy(fields()[0].schema(), other.actor); fieldSetFlags()[0] = true; } this.actorBuilder = null; }
/** * Creates a Builder by copying an existing Builder. * @param other The existing Builder to copy. */ private Builder(com.homeaway.digitalplatform.streamregistry.Producer.Builder other) { super(other); if (isValidValue(fields()[0], other.actor)) { this.actor = data().deepCopy(fields()[0].schema(), other.actor); fieldSetFlags()[0] = true; } if (other.hasActorBuilder()) { this.actorBuilder = com.homeaway.digitalplatform.streamregistry.Actor.newBuilder(other.getActorBuilder()); } }
@Override @SuppressWarnings("unchecked") public Producer build() { try { Producer record = new Producer(); if (actorBuilder != null) { record.actor = this.actorBuilder.build(); } else { record.actor = fieldSetFlags()[0] ? this.actor : (com.homeaway.digitalplatform.streamregistry.Actor) defaultValue(fields()[0]); } return record; } catch (java.lang.Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } }
/** * Sets the value of the 'actor' field. * * Actor configuration for the producer * @param value The value of 'actor'. * @return This builder. */ public com.homeaway.digitalplatform.streamregistry.Producer.Builder setActor(com.homeaway.digitalplatform.streamregistry.Actor value) { validate(fields()[0], value); this.actorBuilder = null; this.actor = value; fieldSetFlags()[0] = true; return this; }
/** * Checks whether the 'actor' field has been set. * * Actor configuration for the producer * @return True if the 'actor' field has been set, false otherwise. */ public boolean hasActor() { return fieldSetFlags()[0]; }
/** * Clears the value of the 'actor' field. * * Actor configuration for the producer * @return This builder. */ public com.homeaway.digitalplatform.streamregistry.Producer.Builder clearActor() { actor = null; actorBuilder = null; fieldSetFlags()[0] = false; return this; }