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 boolean
equals(java.lang.Object obj)
com.google.common.base.Optional<V>
error()
Retrieve the error of the scalarint
hashCode()
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.String
toString()
V
value()
-
-
-
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:
value
in interfaceErronousValue<V>
-
error
public com.google.common.base.Optional<V> error()
Description copied from interface:ErronousValue
Retrieve the error of the scalar- Specified by:
error
in interfaceErronousValue<V>
- Returns:
- the error
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-