public class JsonEventImpl extends Object implements JsonEvent
| Constructor and Description |
|---|
JsonEventImpl(JsonEventType type,
String field,
Object value) |
JsonEventImpl(JsonEventType type,
String field,
Object value,
TokenBuffer buffer) |
| Modifier and Type | Method and Description |
|---|---|
JsonArray |
arrayValue() |
Buffer |
binaryValue()
Return the binary value.
|
Boolean |
booleanValue() |
Double |
doubleValue() |
String |
fieldName() |
Float |
floatValue() |
Instant |
instantValue()
Return the
Instant value. |
Integer |
integerValue() |
boolean |
isArray() |
boolean |
isBoolean() |
boolean |
isNull() |
boolean |
isNumber() |
boolean |
isObject() |
boolean |
isString() |
Long |
longValue() |
<T> T |
mapTo(Class<T> type)
Decodes and returns the current value as the specified
type. |
<T> T |
mapTo(TypeReference<T> type)
Decodes and returns the current value as the specified
type. |
JsonObject |
objectValue() |
String |
stringValue() |
JsonEventType |
type() |
Object |
value() |
public JsonEventImpl(JsonEventType type, String field, Object value)
public JsonEventImpl(JsonEventType type, String field, Object value, TokenBuffer buffer)
public JsonEventType type()
public String fieldName()
public Object value()
value in interface JsonEventJsonEventType.VALUE eventspublic boolean isNumber()
public boolean isBoolean()
public boolean isString()
public boolean isNull()
public boolean isObject()
public boolean isArray()
public <T> T mapTo(Class<T> type)
JsonEventtype.public <T> T mapTo(TypeReference<T> type)
JsonEventtype.public Integer integerValue()
integerValue in interface JsonEventInteger value or null if the event has no JSON valuepublic Long longValue()
public Float floatValue()
floatValue in interface JsonEventFloat value or null if the event has no JSON valuepublic Double doubleValue()
doubleValue in interface JsonEventDouble value or null if the event has no JSON valuepublic Boolean booleanValue()
booleanValue in interface JsonEventBoolean value or null if the event has no JSON valuepublic String stringValue()
stringValue in interface JsonEventnull if the event has no JSON valuepublic Buffer binaryValue()
JsonEventJSON itself has no notion of a binary, this extension complies to the RFC-7493, so this method assumes there is a String value with the key and it contains a Base64 encoded binary, which it decodes if found and returns.
binaryValue in interface JsonEventnull if the event has no JSON valuepublic Instant instantValue()
JsonEventInstant value.
JSON itself has no notion of a temporal types, this extension complies to the RFC-7493, so this method assumes there is a String value with the key and it contains an ISO 8601 encoded date and time format such as "2017-04-03T10:25:41Z", which it decodes if found and returns.
instantValue in interface JsonEventInstant value or null if the event has no JSON valuepublic JsonObject objectValue()
objectValue in interface JsonEventnull if the event has no JSON valuepublic JsonArray arrayValue()
arrayValue in interface JsonEventnull if the event has no JSON valueCopyright © 2020. All rights reserved.