Package io.vavr.control
Class Validation.Invalid<E,T>
- java.lang.Object
-
- io.vavr.control.Validation.Invalid<E,T>
-
- Type Parameters:
E- type of the error of this ValidationT- type of the value of this Validation
- All Implemented Interfaces:
Validation<E,T>,Value<T>,java.io.Serializable,java.lang.Iterable<T>
- Enclosing interface:
- Validation<E,T>
public static final class Validation.Invalid<E,T> extends java.lang.Object implements Validation<E,T>, java.io.Serializable
An invalid Validation- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.vavr.control.Validation
Validation.Builder<E,T1,T2>, Validation.Builder3<E,T1,T2,T3>, Validation.Builder4<E,T1,T2,T3,T4>, Validation.Builder5<E,T1,T2,T3,T4,T5>, Validation.Builder6<E,T1,T2,T3,T4,T5,T6>, Validation.Builder7<E,T1,T2,T3,T4,T5,T6,T7>, Validation.Builder8<E,T1,T2,T3,T4,T5,T6,T7,T8>, Validation.Invalid<E,T>, Validation.Valid<E,T>
-
-
Field Summary
Fields Modifier and Type Field Description private Eerrorprivate static longserialVersionUID
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)Clarifies that values have a proper equals() method implemented.Tget()Gets the value of thisValidationif is aValidor throws if this is anInvalid.EgetError()Gets the error of this Validation if it is anInvalidor throws if this is aValid.inthashCode()Clarifies that values have a proper hashCode() method implemented.booleanisInvalid()Check whether this is of typeInvalidbooleanisValid()Check whether this is of typeValidjava.lang.StringstringPrefix()Returns the name of this Value type, which is used by toString().java.lang.StringtoString()Clarifies that values have a proper toString() method implemented.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.vavr.control.Validation
ap, bimap, combine, filter, flatMap, fold, forEach, getOrElseGet, isAsync, isEmpty, isLazy, isSingleValued, iterator, map, mapError, orElse, orElse, peek, swap, toEither
-
Methods inherited from interface io.vavr.Value
collect, collect, contains, corresponds, eq, exists, forAll, getOrElse, getOrElse, getOrElseThrow, getOrElseTry, getOrNull, out, out, spliterator, stderr, stdout, toArray, toCharSeq, toCompletableFuture, toEither, toEither, toInvalid, toInvalid, toJavaArray, toJavaArray, toJavaArray, toJavaCollection, toJavaList, toJavaList, toJavaMap, toJavaMap, toJavaMap, toJavaOptional, toJavaParallelStream, toJavaSet, toJavaSet, toJavaStream, toLeft, toLeft, toLinkedMap, toLinkedMap, toLinkedSet, toList, toMap, toMap, toOption, toPriorityQueue, toPriorityQueue, toQueue, toRight, toRight, toSet, toSortedMap, toSortedMap, toSortedMap, toSortedMap, toSortedSet, toSortedSet, toStream, toTree, toTree, toTry, toTry, toValid, toValid, toValidation, toValidation, toVector
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
error
private final E error
-
-
Constructor Detail
-
Invalid
private Invalid(E error)
Construct anInvalid- Parameters:
error- The value of this error
-
-
Method Detail
-
isValid
public boolean isValid()
Description copied from interface:ValidationCheck whether this is of typeValid- Specified by:
isValidin interfaceValidation<E,T>- Returns:
- true if is a Valid, false if is an Invalid
-
isInvalid
public boolean isInvalid()
Description copied from interface:ValidationCheck whether this is of typeInvalid- Specified by:
isInvalidin interfaceValidation<E,T>- Returns:
- true if is an Invalid, false if is a Valid
-
get
public T get() throws java.lang.RuntimeException
Description copied from interface:ValidationGets the value of thisValidationif is aValidor throws if this is anInvalid.
-
getError
public E getError()
Description copied from interface:ValidationGets the error of this Validation if it is anInvalidor throws if this is aValid.- Specified by:
getErrorin interfaceValidation<E,T>- Returns:
- The error, if present
-
equals
public boolean equals(java.lang.Object obj)
Description copied from interface:ValueClarifies that values have a proper equals() method implemented.
-
hashCode
public int hashCode()
Description copied from interface:ValueClarifies that values have a proper hashCode() method implemented.See Object.hashCode().
-
stringPrefix
public java.lang.String stringPrefix()
Description copied from interface:ValueReturns the name of this Value type, which is used by toString().- Specified by:
stringPrefixin interfaceValue<E>- Returns:
- This type name.
-
toString
public java.lang.String toString()
Description copied from interface:ValueClarifies that values have a proper toString() method implemented.See Object.toString().
-
-