Package jsonvalues

Class JsBigInt

    • Field Detail

      • x

        public final BigInteger x
        the big integer value.
    • Method Detail

      • equals

        public boolean equals​(@Nullable Object that)
        Indicates whether some other object is "equal to" this json big integer. 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
      • hashCode

        public int hashCode()
        Returns the hashcode of this json big integer.
        Overrides:
        hashCode in class Object
        Returns:
        the hashcode of this JsBigInt
      • map

        public JsBigInt map​(UnaryOperator<BigInteger> fn)
        Maps this json bigint into another one.
        Parameters:
        fn - the mapping function
        Returns:
        a new JsBigInt
      • test

        public boolean test​(Predicate<BigInteger> predicate)
        Tests the value of this json bigint on a predicate.
        Parameters:
        predicate - the predicate
        Returns:
        true if this big integer satisfies the predicate
      • of

        public static JsBigInt of​(BigInteger n)
        Static factory method to create a JsBigInt from BigInteger objects.
        Parameters:
        n - the big integer
        Returns:
        a new JsBigInt
      • intValueExact

        public OptionalInt intValueExact()
        Returns the value of this biginteger; or an empty optional if the value overflows an int.
        Returns:
        this biginteger as an int wrapped in an OptionalInt
      • longValueExact

        public OptionalLong longValueExact()
        Returns the value of this biginteger; or an empty optional if the value overflows an long.
        Returns:
        this biginteger as an long wrapped in an OptionalLong
      • equals

        public boolean equals​(JsBigDec jsBigDec)
        returns true if this bigint and the specified bigdecimal represent the same number
        Parameters:
        jsBigDec - the specified JsBigDec
        Returns:
        true if both JsElem are the same value
      • equals

        public boolean equals​(JsInt jsInt)
        returns true if this biginteger and the specified integer represent the same number
        Parameters:
        jsInt - the specified JsInt
        Returns:
        true if both JsElem are the same value
      • equals

        public boolean equals​(JsLong jsLong)
        returns true if this bigint and the specified long represent the same number
        Parameters:
        jsLong - the specified JsLong
        Returns:
        true if both JsElem are the same value
      • equals

        public boolean equals​(JsDouble jsDouble)
        returns true if this bigint and the specified double represent the same number
        Parameters:
        jsDouble - the specified JsDouble
        Returns:
        true if both JsElem are the same value
      • isInt

        public boolean isInt()
        Specified by:
        isInt in interface JsElem
        Returns:
        true if this JsElem is a JsInt
      • isDouble

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

        public boolean isBigDec()
        Specified by:
        isBigDec in interface JsElem
        Returns:
        true if this JsElem is a JsBigDec
      • isLong

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

        public boolean isBigInt()
        Specified by:
        isBigInt in interface JsElem
        Returns:
        true if this JsElem is a JsBigInt