JsonString Class
- java.
lang. Object - com.
azure. json. models. JsonElement - com.
azure. json. models. JsonString
- com.
- com.
public final class JsonString
extends JsonElement
Class representing the JSON string type
Constructor Summary
| Constructor | Description |
|---|---|
| JsonString(String value) |
Constructor used to explicitly set the string value of the Json |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
|
static
Json |
fromJson(JsonReader jsonReader)
Deserializes a JSON string from a Json |
| String |
getValue()
Gets the string value of this Json |
| boolean |
isString()
Indicates whether the element is a string. |
|
Json |
toJson(JsonWriter jsonWriter) |
| String | toJsonString() |
Methods inherited from JsonElement
Methods inherited from java.lang.Object
Constructor Details
JsonString
public JsonString(String value)
Constructor used to explicitly set the string value of the JsonString object. Adds the starting and ending double quotation marks.
Parameters:
Method Details
fromJson
public static JsonString fromJson(JsonReader jsonReader)
Deserializes a JSON string from a JsonReader.
If the JsonReader's current token is null, it is assumed the JsonReader hasn't begun reading and nextToken() will be called to begin reading.
After ensuring the JsonReader has begun reading, if the current token is not STRING, an IllegalStateException will be thrown. Otherwise, a JSON string representing the string value will be created and returned.
Parameters:
Returns:
Throws:
getValue
public String getValue()
Gets the string value of this JsonString object.
Returns:
isString
public boolean isString()
Indicates whether the element is a string.
Overrides:
JsonString.isString()Returns: