Top Fields Constructors Methods
io.vertx.core.parsetools.impl

public Class JsonEventImpl

extends Object
implements JsonEvent
Class Inheritance
All Implemented Interfaces
io.vertx.core.parsetools.JsonEvent
Imports
com.fasterxml.jackson.core.JsonToken, com.fasterxml.jackson.core.type.TypeReference, io.vertx.core.buffer.Buffer, io.vertx.core.json.DecodeException, .JsonArray, .JsonObject, io.vertx.core.json.jackson.JacksonFactory, io.vertx.core.parsetools.JsonEvent, .JsonEventType, java.time.Instant

Author
Julien Viet

Field Summary

Modifier and TypeField and Description
private final String
private final JsonToken
private final JsonEventType
private final Object

Constructor Summary

AccessConstructor and Description
public
JsonEventImpl(JsonToken token, JsonEventType type, String field, Object value)

Method Summary

Modifier and TypeMethod and Description
public JsonArray
arrayValue()

Implements io.vertx.core.parsetools.JsonEvent.arrayValue.

References Deprecated JsonArray is deprecated or references (maybe indirectly) at least one deprecated element.

public Buffer
binaryValue()

Implements io.vertx.core.parsetools.JsonEvent.binaryValue.

References Deprecated Buffer is deprecated or references (maybe indirectly) at least one deprecated element.

Return the binary value.

public Boolean
public Double
public String
public Float
public Instant
instantValue()

Implements io.vertx.core.parsetools.JsonEvent.instantValue.

Return the Instant value.

public Integer
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public Long
public <T> T
mapTo(Class<T>
the type to decode the value to
type
)

Implements io.vertx.core.parsetools.JsonEvent.mapTo.

Decodes and returns the current value as the specified type.

public <T> T
mapTo(TypeReference<T>
the type to decode the value to
type
)

Implements io.vertx.core.parsetools.JsonEvent.mapTo.

Decodes and returns the current value as the specified type.

public JsonObject
objectValue()

Implements io.vertx.core.parsetools.JsonEvent.objectValue.

References Deprecated JsonObject is deprecated or references (maybe indirectly) at least one deprecated element.

public String
public JsonToken
public JsonEventType
public Object
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

fieldback to summary
private final String field
tokenback to summary
private final JsonToken token
typeback to summary
private final JsonEventType type
valueback to summary
private final Object value

Constructor Detail

JsonEventImplback to summary
public JsonEventImpl(JsonToken token, JsonEventType type, String field, Object value)

Method Detail

arrayValueback to summary
public JsonArray arrayValue()

Implements io.vertx.core.parsetools.JsonEvent.arrayValue.

References Deprecated

JsonArray is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Returns:JsonArray

Doc from io.vertx.core.parsetools.JsonEvent.arrayValue.

the JSON array value or null if the event has no JSON value

Annotations
@Override
binaryValueback to summary
public Buffer binaryValue()

Implements io.vertx.core.parsetools.JsonEvent.binaryValue.

Doc from io.vertx.core.parsetools.JsonEvent.binaryValue.

References Deprecated

Buffer is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Return the binary value.

JSON 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.

Returns:Buffer

the binary value or null if the event has no JSON value

Annotations
@Override
booleanValueback to summary
public Boolean booleanValue()

Implements io.vertx.core.parsetools.JsonEvent.booleanValue.

Returns:Boolean

Doc from io.vertx.core.parsetools.JsonEvent.booleanValue.

the Boolean value or null if the event has no JSON value

Annotations
@Override
doubleValueback to summary
public Double doubleValue()

Implements io.vertx.core.parsetools.JsonEvent.doubleValue.

Returns:Double

Doc from io.vertx.core.parsetools.JsonEvent.doubleValue.

the Double value or null if the event has no JSON value

Annotations
@Override
fieldNameback to summary
public String fieldName()

Implements io.vertx.core.parsetools.JsonEvent.fieldName.

Returns:String

Doc from io.vertx.core.parsetools.JsonEvent.fieldName.

the name of the field when the event is emitted as a JSON object member

Annotations
@Override
floatValueback to summary
public Float floatValue()

Implements io.vertx.core.parsetools.JsonEvent.floatValue.

Returns:Float

Doc from io.vertx.core.parsetools.JsonEvent.floatValue.

the Float value or null if the event has no JSON value

Annotations
@Override
instantValueback to summary
public Instant instantValue()

Implements io.vertx.core.parsetools.JsonEvent.instantValue.

Doc from io.vertx.core.parsetools.JsonEvent.instantValue.

Return the Instant 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.

Returns:Instant

the Instant value or null if the event has no JSON value

Annotations
@Override
integerValueback to summary
public Integer integerValue()

Implements io.vertx.core.parsetools.JsonEvent.integerValue.

Returns:Integer

Doc from io.vertx.core.parsetools.JsonEvent.integerValue.

the Integer value or null if the event has no JSON value

Annotations
@Override
isArrayback to summary
public boolean isArray()

Implements io.vertx.core.parsetools.JsonEvent.isArray.

Returns:boolean

Doc from io.vertx.core.parsetools.JsonEvent.isArray.

true when the JSON value is a JSON array

Annotations
@Override
isBooleanback to summary
public boolean isBoolean()

Implements io.vertx.core.parsetools.JsonEvent.isBoolean.

Returns:boolean

Doc from io.vertx.core.parsetools.JsonEvent.isBoolean.

true when the JSON value is a boolean

Annotations
@Override
isNullback to summary
public boolean isNull()

Implements io.vertx.core.parsetools.JsonEvent.isNull.

Returns:boolean

Doc from io.vertx.core.parsetools.JsonEvent.isNull.

true when the JSON value is null

Annotations
@Override
isNumberback to summary
public boolean isNumber()

Implements io.vertx.core.parsetools.JsonEvent.isNumber.

Returns:boolean

Doc from io.vertx.core.parsetools.JsonEvent.isNumber.

true when the JSON value is a number

Annotations
@Override
isObjectback to summary
public boolean isObject()

Implements io.vertx.core.parsetools.JsonEvent.isObject.

Returns:boolean

Doc from io.vertx.core.parsetools.JsonEvent.isObject.

true when the JSON value is a JSON object

Annotations
@Override
isStringback to summary
public boolean isString()

Implements io.vertx.core.parsetools.JsonEvent.isString.

Returns:boolean

Doc from io.vertx.core.parsetools.JsonEvent.isString.

true when the JSON value is a string

Annotations
@Override
longValueback to summary
public Long longValue()

Implements io.vertx.core.parsetools.JsonEvent.longValue.

Returns:Long

Doc from io.vertx.core.parsetools.JsonEvent.longValue.

the Long value or null if the event has no JSON value

Annotations
@Override
mapToback to summary
public <T> T mapTo(Class<T> type)

Implements io.vertx.core.parsetools.JsonEvent.mapTo.

Doc from io.vertx.core.parsetools.JsonEvent.mapTo.

Decodes and returns the current value as the specified type.

Parameters
type:Class<T>

the type to decode the value to

Returns:T

the decoded value

Annotations
@Override
mapToback to summary
public <T> T mapTo(TypeReference<T> type)

Implements io.vertx.core.parsetools.JsonEvent.mapTo.

Doc from io.vertx.core.parsetools.JsonEvent.mapTo.

Decodes and returns the current value as the specified type.

Parameters
type:TypeReference<T>

the type to decode the value to

Returns:T

the decoded value

Annotations
@Override
objectValueback to summary
public JsonObject objectValue()

Implements io.vertx.core.parsetools.JsonEvent.objectValue.

References Deprecated

JsonObject is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Returns:JsonObject

Doc from io.vertx.core.parsetools.JsonEvent.objectValue.

the JSON object value or null if the event has no JSON value

Annotations
@Override
stringValueback to summary
public String stringValue()

Implements io.vertx.core.parsetools.JsonEvent.stringValue.

Returns:String

Doc from io.vertx.core.parsetools.JsonEvent.stringValue.

the string value or null if the event has no JSON value

Annotations
@Override
tokenback to summary
public JsonToken token()
typeback to summary
public JsonEventType type()

Implements io.vertx.core.parsetools.JsonEvent.type.

Returns:JsonEventType

Doc from io.vertx.core.parsetools.JsonEvent.type.

the type of the event

Annotations
@Override
valueback to summary
public Object value()

Implements io.vertx.core.parsetools.JsonEvent.value.

Returns:Object

Doc from io.vertx.core.parsetools.JsonEvent.value.

the json value for JsonEventType#VALUE events

Annotations
@Override