Package io.vertx.mutiny.json.schema
Class JsonSchema
- java.lang.Object
-
- io.vertx.mutiny.json.schema.JsonSchema
-
public class JsonSchema extends Object
A Json-Schema holder. There are 2 kinds of Json-Schema's:- JSON Object based
- Boolean based
originalnon Mutiny-ified interface using Vert.x codegen.
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<JsonSchema>__TYPE_ARG
-
Constructor Summary
Constructors Constructor Description JsonSchema(io.vertx.json.schema.JsonSchema delegate)JsonSchema(Object delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description JsonSchemaannotate(String key, String value)booleancontainsKey(String key)booleanequals(Object o)Set<String>fieldNames()<R> Rget(String key)<R> Rget(String key, R fallback)io.vertx.json.schema.JsonSchemagetDelegate()inthashCode()static JsonSchemanewInstance(io.vertx.json.schema.JsonSchema arg)static JsonSchemaof(boolean bool)static JsonSchemaof(io.vertx.core.json.JsonObject json)static JsonSchemaof(String id, io.vertx.core.json.JsonObject json)io.vertx.core.json.JsonObjectresolve()StringtoString()
-
-
-
Field Detail
-
__TYPE_ARG
public static final TypeArg<JsonSchema> __TYPE_ARG
-
-
Constructor Detail
-
JsonSchema
public JsonSchema(io.vertx.json.schema.JsonSchema delegate)
-
JsonSchema
public JsonSchema(Object delegate)
-
-
Method Detail
-
getDelegate
public io.vertx.json.schema.JsonSchema getDelegate()
-
of
public static JsonSchema of(io.vertx.core.json.JsonObject json)
- Parameters:
json- a JSON Object.- Returns:
- a wrapper for the input object.
-
of
public static JsonSchema of(String id, io.vertx.core.json.JsonObject json)
- Parameters:
id- will force the given id as the schema $id.json- a JSON Object.- Returns:
- a wrapper for the input object.
-
of
public static JsonSchema of(boolean bool)
- Parameters:
bool- a boolean.- Returns:
- a wrapper for the input object.
-
annotate
public JsonSchema annotate(String key, String value)
- Parameters:
key- a keyvalue- a value- Returns:
- the instance of JsonSchema to chain method calls.
-
get
public <R> R get(String key)
- Parameters:
key- a key- Returns:
- the value or
null
-
get
public <R> R get(String key, R fallback)
- Parameters:
key- a keyfallback- fallback when key is not present- Returns:
- the value or
null
-
containsKey
public boolean containsKey(String key)
- Parameters:
key- a key- Returns:
trueif present
-
resolve
public io.vertx.core.json.JsonObject resolve()
- Returns:
- a new representing the schema with
$refs replaced by their value.
-
newInstance
public static JsonSchema newInstance(io.vertx.json.schema.JsonSchema arg)
-
-