public class VertxExtensionModule extends Object
Constructor and Description |
---|
VertxExtensionModule() |
Modifier and Type | Method and Description |
---|---|
static boolean |
asBoolean(AsyncResult self)
Coerces an
AsyncResult as a boolean value according to Groovy-Truth. |
static Object |
asType(Map map,
Class clazz)
Convert a JSON like map data structure to a Vert.x data object or a
JsonObject . |
static Object |
getAt(JsonArray json,
int idx)
Subscript operator for
JsonArray , the read part. |
static Object |
getAt(JsonObject json,
String key)
Subscript operator for
JsonObject , the read part. |
static void |
leftShift(JsonArray json,
Object value)
<< operator for JsonObject . |
static Object |
putAt(JsonObject json,
String key,
Object value)
Subscript operator for
JsonObject , the write part. |
public static Object asType(Map map, Class clazz) throws Throwable
JsonObject
.
The data object is a class annotated by DataObject
that provides a public constructor
with a JsonObject
argument.
map
- the JSON like map like data structureclazz
- the target type which can be a Java class annotated with DataObject
and provides a JsonObject
constructor, or JsonObject
clazz
Throwable
public static Object getAt(JsonObject json, String key)
JsonObject
, the read part.json
- the json objectkey
- the keykey
public static Object putAt(JsonObject json, String key, Object value)
JsonObject
, the write part.json
- the json objectkey
- the keyvalue
- the json valuekey
public static Object getAt(JsonArray json, int idx)
JsonArray
, the read part.json
- the json arrayidx
- the idxidx
public static void leftShift(JsonArray json, Object value)
<<
operator for JsonObject
.json
- the json objectvalue
- the json valuepublic static boolean asBoolean(AsyncResult self)
AsyncResult
as a boolean value according to Groovy-Truth.self
- the AsyncResult
instanceCopyright © 2024 Eclipse. All rights reserved.