Package org.tensorics.core.quantity
Class ImmutableErronousValue<V>
- java.lang.Object
-
- org.tensorics.core.quantity.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 Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)com.google.common.base.Optional<V>error()Retrieve the error of the scalarinthashCode()static <V> ImmutableErronousValue<V>ofValue(V value)static <V> ImmutableErronousValue<V>ofValueAndError(V value, com.google.common.base.Optional<V> error)static <V> ImmutableErronousValue<V>ofValueAndError(V value, V error)java.lang.StringtoString()Vvalue()
-
-
-
Method Detail
-
ofValue
public static <V> ImmutableErronousValue<V> ofValue(V value)
-
ofValueAndError
public static <V> ImmutableErronousValue<V> ofValueAndError(V value, V error)
-
ofValueAndError
public static <V> ImmutableErronousValue<V> ofValueAndError(V value, com.google.common.base.Optional<V> error)
-
value
public V value()
- Specified by:
valuein interfaceErronousValue<V>
-
error
public com.google.common.base.Optional<V> error()
Description copied from interface:ErronousValueRetrieve the error of the scalar- Specified by:
errorin interfaceErronousValue<V>- Returns:
- the error
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-