Package jsonvalues

Class JsDouble

    • Field Detail

      • value

        public final double value
        The double value.
    • Method Detail

      • id

        public int id()
        Specified by:
        id in interface JsValue
      • equals

        public boolean equals​(@Nullable Object that)
        Indicates whether some other object is "equal to" this json double. Numbers of different types are equals if the have the same value.
        Overrides:
        equals in class Object
        Parameters:
        that - the reference object with which to compare.
        Returns:
        true if that is a JsNumber with the same value as this JsDouble
      • hashCode

        public int hashCode()
        Returns the hashcode of this json double.
        Overrides:
        hashCode in class Object
        Returns:
        the hashcode of this JsDouble
      • map

        public JsDouble map​(DoubleUnaryOperator fn)
        Maps this json double into another one.
        Parameters:
        fn - the mapping function
        Returns:
        a new JsDouble
      • of

        public static JsDouble of​(double n)
        Static factory method to create a JsDouble from a double primitive type.
        Parameters:
        n - the double primitive type
        Returns:
        a new JsDouble
      • test

        public boolean test​(DoublePredicate predicate)
        Tests the value of this json double on a predicate.
        Parameters:
        predicate - the predicate
        Returns:
        true if this double satisfies the predicate
      • isDouble

        public boolean isDouble()
        Specified by:
        isDouble in interface JsValue
        Returns:
        true if this JsElem is a JsDouble