Class ImmutableErronousValue<V>

  • Type Parameters:
    V - the type of the value and the error
    All Implemented Interfaces:
    java.io.Serializable, ErronousValue<V>

    public final class ImmutableErronousValue<V>
    extends java.lang.Object
    implements ErronousValue<V>
    An immutable object that guarantees to have a value and an error.
    See Also:
    Serialized Form
    • Method Detail

      • ofValueAndError

        public static <V> ImmutableErronousValue<V> ofValueAndError​(V value,
                                                                    com.google.common.base.Optional<V> error)
      • error

        public com.google.common.base.Optional<V> error()
        Description copied from interface: ErronousValue
        Retrieve the error of the scalar
        Specified by:
        error in interface ErronousValue<V>
        Returns:
        the error
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object