Class JSONValue
- java.lang.Object
-
- com.dynatrace.openkit.util.json.objects.JSONValue
-
- Direct Known Subclasses:
JSONArrayValue,JSONBooleanValue,JSONNullValue,JSONNumberValue,JSONObjectValue,JSONStringValue
public abstract class JSONValue extends java.lang.ObjectBase class for all JSON value classes (e.g. string, number)
-
-
Constructor Summary
Constructors Constructor Description JSONValue()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisArray()Get a boolean indicating whether this instance represents an JSON array value or not.booleanisBoolean()Get a boolean indicating whether this instance represents a JSON boolean value or not.booleanisNull()Get a boolean indicating whether this instance represents a JSON null value or not.booleanisNumber()Get a boolean indicating whether this instance represents a JSON numeric value or not.booleanisObject()Get a boolean indicating whether this instance represents an JSON object value or not.booleanisString()Get a boolean indicating whether this instance represents a JSON string value or not.java.lang.StringtoString()Returns a string representation of the JSON valuejava.lang.StringtoString(JSONOutputConfig config)Returns a string representation of the JSON value but allows the option to pass a configuration which changes the string output
-
-
-
Method Detail
-
isNull
public boolean isNull()
Get a boolean indicating whether this instance represents a JSON null value or not.- Returns:
truefor objects representing a null value,falseotherwise.
-
isBoolean
public boolean isBoolean()
Get a boolean indicating whether this instance represents a JSON boolean value or not.- Returns:
truefor objects representing a boolean value,falseotherwise.
-
isNumber
public boolean isNumber()
Get a boolean indicating whether this instance represents a JSON numeric value or not.- Returns:
truefor objects representing a numeric value,falseotherwise.
-
isString
public boolean isString()
Get a boolean indicating whether this instance represents a JSON string value or not.- Returns:
truefor objects representing a string value,falseotherwise.
-
isArray
public boolean isArray()
Get a boolean indicating whether this instance represents an JSON array value or not.- Returns:
truefor objects representing an array value,falseotherwise.
-
isObject
public boolean isObject()
Get a boolean indicating whether this instance represents an JSON object value or not.- Returns:
truefor objects representing an object value,falseotherwise.
-
toString
public java.lang.String toString()
Returns a string representation of the JSON value- Overrides:
toStringin classjava.lang.Object- Returns:
- json string
-
toString
public java.lang.String toString(JSONOutputConfig config)
Returns a string representation of the JSON value but allows the option to pass a configuration which changes the string output- Parameters:
config- Configuration which changes the output- Returns:
- json string
-
-