Class ImmutableQuantifiedValue<V>

  • Type Parameters:
    V - the type of the (numerical) scalar values.
    All Implemented Interfaces:
    java.io.Serializable, ErronousValue<V>, Quantified, QuantifiedValue<V>, ValidityAware

    public final class ImmutableQuantifiedValue<V>
    extends java.lang.Object
    implements QuantifiedValue<V>
    Groups a value together with its base. Additionally an error and a validity flag can be provided. If the latter two are not present explicitely given, then the validity will be true and the (optional) error will not be present.
    See Also:
    Serialized Form
    • Method Detail

      • unit

        public Unit unit()
        Description copied from interface: Quantified
        Retrieves the base of the entity
        Specified by:
        unit in interface Quantified
        Returns:
        the base of the quantified entity.
      • validity

        public java.lang.Boolean validity()
        Description copied from interface: ValidityAware
        Retrieves the validity flag of the object.
        Specified by:
        validity in interface ValidityAware
        Returns:
        true if the content is valid, false if it is not.
      • 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
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • 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