Class JSONBooleanValue
- java.lang.Object
-
- com.dynatrace.openkit.util.json.objects.JSONValue
-
- com.dynatrace.openkit.util.json.objects.JSONBooleanValue
-
public class JSONBooleanValue extends JSONValue
JSON value class representing a boolean value.
-
-
Field Summary
Fields Modifier and Type Field Description static JSONBooleanValueFALSEsingleton instance representing false.static JSONBooleanValueTRUEsingleton instance representing true.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static JSONBooleanValuefromLiteral(java.lang.String literal)Factory method to create aJSONBooleanValuefrom a given JSON literal.static JSONBooleanValuefromValue(boolean value)Factory method to create aJSONBooleanValuefrom a given boolean value.booleangetValue()Get value represented by this instance.booleanisBoolean()Get a boolean indicating whether this instance represents a JSON boolean value or not.
-
-
-
Field Detail
-
TRUE
public static final JSONBooleanValue TRUE
singleton instance representing true.
-
FALSE
public static final JSONBooleanValue FALSE
singleton instance representing false.
-
-
Method Detail
-
fromValue
public static JSONBooleanValue fromValue(boolean value)
Factory method to create aJSONBooleanValuefrom a given boolean value.The return value is one of the two singleton instances
TRUEorFALSE, depending onvalue.
-
fromLiteral
public static JSONBooleanValue fromLiteral(java.lang.String literal)
Factory method to create aJSONBooleanValuefrom a given JSON literal.- Parameters:
literal- The string literal for which to create the value.- Returns:
TRUEif literal isJSONLiterals.BOOLEAN_TRUE_LITERAL,FALSEif literal isJSONLiterals.BOOLEAN_FALSE_LITERALandnullin every other case.
-
isBoolean
public boolean isBoolean()
Description copied from class:JSONValueGet a boolean indicating whether this instance represents a JSON boolean value or not.
-
getValue
public boolean getValue()
Get value represented by this instance.- Returns:
- Boolean value represented by this instance.
-
-