Class JSONString


  • public class JSONString
    extends JSONSimple
    Represents a JSON delimited string. Examples are: "Hello" and "World"; "Hello\nWorld" contains a newline. Strings are always delimited with double quotes.
    • Field Detail

      • value

        private java.lang.String value
    • Constructor Detail

      • JSONString

        public JSONString​(java.lang.String value)
    • Method Detail

      • getValue

        public java.lang.String getValue()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • render

        protected java.lang.String render​(boolean pretty,
                                          java.lang.String indent)
        Description copied from class: JSONValue
        Convert the JSON value into a string representation (JSON representation).
        Specified by:
        render in class JSONValue
        Parameters:
        pretty - Indicating if the print should be made pretty (human readers) or compact (transmission or storage).
        indent - Starting indent.
        Returns:
        A JSON representation.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • strip

        public java.lang.Object strip()
        A pure Java object, all JSON information is removed. A JSONString trivially maps to a Java String.
        Specified by:
        strip in class JSONValue
        Returns:
        A Java String representing the contents of a JSONString.