/** * Copy the current immutable object by setting a value for the {@link Agent#getDebugConfig() debugConfig} attribute. * A shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for debugConfig (can be {@code null}) * @return A modified copy of the {@code this} object */ public final ImmutableAgent withDebugConfig(@Nullable DebugConfig value) { if (this.debugConfig == value) return this; return new ImmutableAgent(this.config, value, this.member); }
/** * Copy the current immutable object by setting a value for the {@link Agent#getMember() member} attribute. * A shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for member * @return A modified copy of the {@code this} object */ public final ImmutableAgent withMember(Member value) { if (this.member == value) return this; return new ImmutableAgent( this.config, this.debugConfig, Preconditions.checkNotNull(value, "member")); }
/** * Copy the current immutable object by setting a value for the {@link Agent#getConfig() config} attribute. * A shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for config * @return A modified copy of the {@code this} object */ public final ImmutableAgent withConfig(Config value) { if (this.config == value) return this; return new ImmutableAgent( Preconditions.checkNotNull(value, "config"), this.debugConfig, this.member); }
/** * Builds a new {@link ImmutableAgent ImmutableAgent}. * @return An immutable instance of Agent * @throws java.lang.IllegalStateException if any required attributes are missing */ public ImmutableAgent build() { if (initBits != 0) { throw new IllegalStateException(formatRequiredAttributesMessage()); } return new ImmutableAgent(config, debugConfig, member); }