Package jsonvalues

Class JsLong

    • Field Detail

      • prism

        public static Prism<JsValue,​Long> prism
        prism between the sum type JsValue and JsLong
      • value

        public final long value
        The long primitive.
    • Method Detail

      • id

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

        public boolean isLong()
        Specified by:
        isLong in interface JsValue
        Returns:
        true if this JsValue is a JsLong
      • hashCode

        public int hashCode()
        Returns the hashcode of this json long.
        Overrides:
        hashCode in class Object
        Returns:
        hashcode of this JsLong
      • equals

        public boolean equals​(Object that)
        Indicates whether some other object is "equal to" this json long. 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 JsLong
      • map

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

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

        public boolean test​(LongPredicate predicate)
        Tests the value of this json long on a predicate.
        Parameters:
        predicate - the predicate
        Returns:
        true if this long satisfies the predicate