Class VertxExtensionModule
java.lang.Object
io.vertx.lang.groovy.VertxExtensionModule
Extension module for integrating Vert.x common types with Groovy.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanasBoolean(AsyncResult self) Coerces anAsyncResultas a boolean value according to Groovy-Truth.static ObjectConvert a JSON like map data structure to a Vert.x data object or aJsonObject.static ObjectSubscript operator forJsonArray, the read part.static ObjectgetAt(JsonObject json, String key) Subscript operator forJsonObject, the read part.static void<<operator forJsonObject.static ObjectputAt(JsonObject json, String key, Object value) Subscript operator forJsonObject, the write part.
-
Constructor Details
-
VertxExtensionModule
public VertxExtensionModule()
-
-
Method Details
-
asType
Convert a JSON like map data structure to a Vert.x data object or aJsonObject.The data object is a class annotated by
DataObjectthat provides a public constructor with aJsonObjectargument.- Parameters:
map- the JSON like map like data structureclazz- the target type which can be a Java class annotated withDataObjectand provides aJsonObjectconstructor, orJsonObject- Returns:
- an instance of the specified
clazz - Throws:
Throwable
-
getAt
Subscript operator forJsonObject, the read part.- Parameters:
json- the json objectkey- the key- Returns:
- the json value for
key
-
putAt
Subscript operator forJsonObject, the write part.- Parameters:
json- the json objectkey- the keyvalue- the json value- Returns:
- the previous json value for
key
-
getAt
-
leftShift
<<operator forJsonObject.- Parameters:
json- the json objectvalue- the json value
-
asBoolean
Coerces anAsyncResultas a boolean value according to Groovy-Truth.- Parameters:
self- theAsyncResultinstance- Returns:
- true if succeeded
-