@ParametersAreNonnullByDefault @Generated(value="org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableValidatedValue<T> extends ValidatedValue<T>
ValidatedValue.
Use the builder to create immutable instances:
ImmutableValidatedValue.builder().
| Modifier and Type | Class and Description |
|---|---|
static class |
ImmutableValidatedValue.Builder<T>
Builds instances of type
ImmutableValidatedValue. |
| Modifier and Type | Method and Description |
|---|---|
static <T> ImmutableValidatedValue.Builder<T> |
builder(ValueSource<T> source)
Creates a builder for
ImmutableValidatedValue. |
static <T> ImmutableValidatedValue<T> |
copyOf(ValidatedValue<T> instance)
Creates an immutable copy of a
ValidatedValue value. |
boolean |
equals(Object another)
This instance is equal to all instances of
ImmutableValidatedValue that have equal attribute values. |
List<ErrorMessage> |
errors()
Returns a lazily initialized value of the
errors attribute. |
int |
hashCode()
Computes a hash code from attributes:
source, valueOrError. |
Set<? extends ValueSource<?>> |
invalidReferences()
Returns a lazily initialized value of the
invalidReferences attribute. |
boolean |
isValid()
Returns a lazily initialized value of the
isValid attribute. |
ValueSource<T> |
source() |
String |
toString()
Prints the immutable value
ValidatedValue with attribute values. |
T |
value()
Returns a lazily initialized value of the
value attribute. |
de.flapdoodle.types.Either<T,ValidationError> |
valueOrError() |
ImmutableValidatedValue<T> |
withSource(ValueSource<T> value)
Copy the current immutable object by setting a value for the
source attribute. |
ImmutableValidatedValue<T> |
withValueOrError(de.flapdoodle.types.Either<T,ValidationError> value)
Copy the current immutable object by setting a value for the
valueOrError attribute. |
of, of, ofpublic ValueSource<T> source()
source in class ValidatedValue<T>source attributepublic de.flapdoodle.types.Either<T,ValidationError> valueOrError()
valueOrError in class ValidatedValue<T>valueOrError attributepublic final ImmutableValidatedValue<T> withSource(ValueSource<T> value)
source attribute.
A shallow reference equality check is used to prevent copying of the same value by returning this.value - A new value for sourcethis objectpublic final ImmutableValidatedValue<T> withValueOrError(de.flapdoodle.types.Either<T,ValidationError> value)
valueOrError attribute.
A shallow reference equality check is used to prevent copying of the same value by returning this.value - A new value for valueOrErrorthis objectpublic boolean equals(@Nullable Object another)
ImmutableValidatedValue that have equal attribute values.public int hashCode()
source, valueOrError.public String toString()
ValidatedValue with attribute values.public boolean isValid()
Returns a lazily initialized value of the isValid attribute.
Initialized once and only once and stored for subsequent access with proper synchronization.
In case of any exception or error thrown by the lazy value initializer,
the result will not be memoised (i.e. remembered) and on next call computation
will be attempted again.
isValid in class ValidatedValue<T>isValid attributepublic List<ErrorMessage> errors()
Returns a lazily initialized value of the errors attribute.
Initialized once and only once and stored for subsequent access with proper synchronization.
In case of any exception or error thrown by the lazy value initializer,
the result will not be memoised (i.e. remembered) and on next call computation
will be attempted again.
errors in class ValidatedValue<T>errors attributepublic T value()
Returns a lazily initialized value of the value attribute.
Initialized once and only once and stored for subsequent access with proper synchronization.
In case of any exception or error thrown by the lazy value initializer,
the result will not be memoised (i.e. remembered) and on next call computation
will be attempted again.
value in class ValidatedValue<T>value attributepublic Set<? extends ValueSource<?>> invalidReferences()
Returns a lazily initialized value of the invalidReferences attribute.
Initialized once and only once and stored for subsequent access with proper synchronization.
In case of any exception or error thrown by the lazy value initializer,
the result will not be memoised (i.e. remembered) and on next call computation
will be attempted again.
invalidReferences in class ValidatedValue<T>invalidReferences attributepublic static <T> ImmutableValidatedValue<T> copyOf(ValidatedValue<T> instance)
ValidatedValue value.
Uses accessors to get values to initialize the new immutable instance.
If an instance is already immutable, it is returned as is.T - generic parameter Tinstance - The instance to copypublic static <T> ImmutableValidatedValue.Builder<T> builder(ValueSource<T> source)
ImmutableValidatedValue.
ImmutableValidatedValue.<T>builder()
.source(de.flapdoodle.formula.ValueSource<T>) // required source
.valueOrError(de.flapdoodle.types.Either<T, de.flapdoodle.formula.validation.ValidationError>) // required valueOrError
.build();
T - generic parameter Tsource - source parameterCopyright © 2023. All rights reserved.