/** * Copy the current immutable object by setting a <i>present</i> value for the optional {@link AcquisitionFlow#state() state} attribute. * @param value The value for state * @return A modified copy of {@code this} object */ public final ImmutableAcquisitionFlow withState(CredentialFlowState value) { @Nullable CredentialFlowState newValue = Objects.requireNonNull(value, "state"); if (this.state == newValue) return this; return validate(new ImmutableAcquisitionFlow(this, this.redirectUrl, this.type, newValue)); }
/** * Copy the current immutable object by setting a value for the {@link AcquisitionFlow#getType() type} attribute. * A value equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for type (can be {@code null}) * @return A modified copy of the {@code this} object */ public final ImmutableAcquisitionFlow withType(Type value) { if (this.type == value) return this; return validate(new ImmutableAcquisitionFlow(this, this.redirectUrl, value, this.state)); }
/** * Copy the current immutable object by setting a value for the {@link AcquisitionFlow#getRedirectUrl() redirectUrl} attribute. * An equals check used to prevent copying of the same value by returning {@code this}. * @param value A new value for redirectUrl (can be {@code null}) * @return A modified copy of the {@code this} object */ public final ImmutableAcquisitionFlow withRedirectUrl(String value) { if (Objects.equals(this.redirectUrl, value)) return this; return validate(new ImmutableAcquisitionFlow(this, value, this.type, this.state)); }
/** * Copy the current immutable object by setting an optional value for the {@link AcquisitionFlow#state() state} attribute. * A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning {@code this}. * @param optional A value for state * @return A modified copy of {@code this} object */ public final ImmutableAcquisitionFlow withState(Optional<? extends CredentialFlowState> optional) { @Nullable CredentialFlowState value = optional.orElse(null); if (this.state == value) return this; return validate(new ImmutableAcquisitionFlow(this, this.redirectUrl, this.type, value)); }
/** * Construct a new immutable {@code AcquisitionFlow} instance. * @param redirectUrl The value for the {@code redirectUrl} attribute * @param type The value for the {@code type} attribute * @param state The value for the {@code state} attribute * @return An immutable AcquisitionFlow instance */ public static AcquisitionFlow of(String redirectUrl, Type type, Optional<CredentialFlowState> state) { return validate(new ImmutableAcquisitionFlow(redirectUrl, type, state)); }