Package jsonvalues

Class JsStr

    • Method Detail

      • id

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

        public boolean isStr()
        Specified by:
        isStr in interface JsValue
        Returns:
        true if this JsElem is a 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
      • equals

        public boolean equals​(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
      • toString

        public String toString()
        Returns the string representation of this json string which is its value quoted.
        Overrides:
        toString in class Object
        Returns:
        the value quoted.
      • 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