Class JSONString

java.lang.Object
ch.epfl.cs107.play.data.json.JSONValue
ch.epfl.cs107.play.data.json.JSONString

public final class JSONString extends JSONValue
Used to represent json strings, ints, doubles and booleans
  • Constructor Details

    • JSONString

      public JSONString(String value)
      Creates a new JSONString with the given value
      Parameters:
      value - (String): The value of the string
  • Method Details

    • set

      public void set(String value)
      Sets the value of this object
      Parameters:
      value - (String): The new value of this object
    • getString

      public String getString()
      Returns the value of this object
      Returns:
      (String): The value of this object as a String
    • toJSONString

      protected String toJSONString()
      Description copied from class: JSONValue
      Serializes the implementing class to a JSON-formatted string.
      Specified by:
      toJSONString in class JSONValue
      Returns:
      A JSON-formatted string representation of the object.