Package jsonvalues

Class JsStr

    • Field Detail

      • x

        public final String x
        The string value.
    • Method Detail

      • equals

        public boolean equals​(@Nullable Object that)
        Indicates whether some other object is "equal to" this json string.
        Overrides:
        equals in class Object
        Parameters:
        that - the reference object with which to compare.
        Returns:
        true if that is a JsStr with the same value as this JsStr
      • test

        public boolean test​(Predicate<String> predicate)
        Tests this JsStr on a predicate.
        Parameters:
        predicate - the predicate
        Returns:
        true if this string satisfies the predicate
      • hashCode

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

        public JsStr map​(UnaryOperator<String> fn)
        Maps this JsStr into another one.
        Parameters:
        fn - the mapping function
        Returns:
        a new JsStr
      • of

        public static JsStr of​(String str)
        Static factory method to create a JsStr from a string.
        Parameters:
        str - the string
        Returns:
        a new JsStr
      • toString

        public String toString()
        Returns the string representation parse this json string which is its value quoted.
        Overrides:
        toString in class Object
        Returns:
        the value quoted.
      • isObj

        public boolean isObj()
        Specified by:
        isObj in interface JsElem
        Returns:
        true if this JsElem is a JsObj
      • isArray

        public boolean isArray()
        Specified by:
        isArray in interface JsElem
        Returns:
        true if this JsElem is a JsArray
      • isNothing

        public boolean isNothing()
        Specified by:
        isNothing in interface JsElem
        Returns:
        true if this element is JsNothing
      • isNull

        public boolean isNull()
        Specified by:
        isNull in interface JsElem
        Returns:
        true if this element is null
      • isNumber

        public boolean isNumber()
        Specified by:
        isNumber in interface JsElem
        Returns:
        true if this element is a number
      • isBool

        public boolean isBool()
        Specified by:
        isBool in interface JsElem
        Returns:
        true if this JsElem is a JsBool
      • isTrue

        public boolean isTrue()
        Specified by:
        isTrue in interface JsElem
        Returns:
        true if this JsElem is a JsBool and it's true
      • isFalse

        public boolean isFalse()
        Specified by:
        isFalse in interface JsElem
        Returns:
        true if this JsElem is a JsBool and it's false
      • 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
      • isStr

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

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