Class Validation.Invalid<E,T>

java.lang.Object
io.vavr.control.Validation.Invalid<E,T>
Type Parameters:
E - type of the error of this Validation
T - type of the value of this Validation
All Implemented Interfaces:
Validation<E,T>, Value<T>, Serializable, Iterable<T>
Enclosing interface:
Validation<E,T>

public static final class Validation.Invalid<E,T> extends Object implements Validation<E,T>, Serializable
An invalid Validation
See Also:
  • Method Details

    • isValid

      public boolean isValid()
      Description copied from interface: Validation
      Check whether this is of type Valid
      Specified by:
      isValid in interface Validation<E,T>
      Returns:
      true if is a Valid, false if is an Invalid
    • isInvalid

      public boolean isInvalid()
      Description copied from interface: Validation
      Check whether this is of type Invalid
      Specified by:
      isInvalid in interface Validation<E,T>
      Returns:
      true if is an Invalid, false if is a Valid
    • get

      public T get() throws RuntimeException
      Description copied from interface: Validation
      Gets the value of this Validation if is a Valid or throws if this is an Invalid.
      Specified by:
      get in interface Validation<E,T>
      Specified by:
      get in interface Value<E>
      Returns:
      The value of this Validation
      Throws:
      RuntimeException
    • getError

      public E getError()
      Description copied from interface: Validation
      Gets the error of this Validation if it is an Invalid or throws if this is a Valid.
      Specified by:
      getError in interface Validation<E,T>
      Returns:
      The error, if present
    • equals

      public boolean equals(Object obj)
      Description copied from interface: Value
      Clarifies that values have a proper equals() method implemented.

      See Object.equals(Object).

      Specified by:
      equals in interface Validation<E,T>
      Specified by:
      equals in interface Value<E>
      Overrides:
      equals in class Object
      Parameters:
      obj - An object
      Returns:
      true, if this equals o, false otherwise
    • hashCode

      public int hashCode()
      Description copied from interface: Value
      Clarifies that values have a proper hashCode() method implemented.

      See Object.hashCode().

      Specified by:
      hashCode in interface Validation<E,T>
      Specified by:
      hashCode in interface Value<E>
      Overrides:
      hashCode in class Object
      Returns:
      The hashcode of this object
    • stringPrefix

      public String stringPrefix()
      Description copied from interface: Value
      Returns the name of this Value type, which is used by toString().
      Specified by:
      stringPrefix in interface Value<E>
      Returns:
      This type name.
    • toString

      public String toString()
      Description copied from interface: Value
      Clarifies that values have a proper toString() method implemented.

      See Object.toString().

      Specified by:
      toString in interface Validation<E,T>
      Specified by:
      toString in interface Value<E>
      Overrides:
      toString in class Object
      Returns:
      A String representation of this object