Class JsonString

java.lang.Object
io.helidon.json.JsonValue
io.helidon.json.JsonString

public final class JsonString extends JsonValue
Represents a JSON string value.

This module is incubating. These APIs may change in any version of Helidon, including backward incompatible changes.

  • Method Details

    • create

      public static JsonString create(String value)
      Create a JsonString from a String value.
      Parameters:
      value - the string value
      Returns:
      a new JsonString
    • create

      public static JsonString create(byte[] value)
      Create a JsonString from an array of UTF-8 encoded bytes.
      Parameters:
      value - the UTF-8 encoded string bytes
      Returns:
      a new JsonString
    • value

      public String value()
      Return the string value of this JsonString.
      Returns:
      the string value
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • type

      public JsonValueType type()
      Description copied from class: JsonValue
      Return the type of this JSON value.
      Specified by:
      type in class JsonValue
      Returns:
      the JsonValueType of this value
    • toJson

      public void toJson(JsonGenerator generator)
      Description copied from class: JsonValue
      Write this JSON value to the provided generator.
      Specified by:
      toJson in class JsonValue
      Parameters:
      generator - the generator to write to