/** * Copy the current immutable object by setting a value for the {@link AcquisitionResponse#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 ImmutableAcquisitionResponse withRedirectUrl(String value) { if (Objects.equals(this.redirectUrl, value)) return this; return validate(new ImmutableAcquisitionResponse(value, this.type, this.state)); }
/** * Construct a new immutable {@code AcquisitionResponse} 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 AcquisitionResponse instance */ public static AcquisitionResponse of(String redirectUrl, Type type, AcquisitionResponse.State state) { return validate(new ImmutableAcquisitionResponse(redirectUrl, type, state)); }
/** * Copy the current immutable object by setting a value for the {@link AcquisitionResponse#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 ImmutableAcquisitionResponse withType(Type value) { if (this.type == value) return this; return validate(new ImmutableAcquisitionResponse(this.redirectUrl, value, this.state)); }
/** * Copy the current immutable object by setting a value for the {@link AcquisitionResponse#state() state} 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 state (can be {@code null}) * @return A modified copy of the {@code this} object */ public final ImmutableAcquisitionResponse withState(AcquisitionResponse.State value) { if (this.state == value) return this; return validate(new ImmutableAcquisitionResponse(this.redirectUrl, this.type, value)); }