public class JsonSchema extends Object
There are 2 kinds of Json-Schema's:
This is a common interface to handle all kinds of schemas.
NOTE: This class has been automatically generated from theoriginal
non RX-ified interface using Vert.x codegen.Modifier and Type | Field and Description |
---|---|
static io.vertx.lang.rx.TypeArg<JsonSchema> |
__TYPE_ARG |
static java.util.function.Predicate<Map.Entry<String,Object>> |
EXCLUDE_ANNOTATION_ENTRIES
Predicate to filter out annotation keys.
|
static java.util.function.Predicate<String> |
EXCLUDE_ANNOTATIONS
Predicate to filter out annotation keys.
|
Constructor and Description |
---|
JsonSchema(JsonSchema delegate) |
JsonSchema(Object delegate) |
Modifier and Type | Method and Description |
---|---|
JsonSchema |
annotate(String key,
String value)
Annotates the schema.
|
boolean |
containsKey(String key)
Checks if the given key is present in the schema object.
|
boolean |
equals(Object o) |
Set<String> |
fieldNames()
Returns the field names on the underlying object.
|
<R> R |
get(String key)
Get a type casted value by key.
|
<R> R |
get(String key,
R fallback)
Get a type casted value by key.
|
JsonSchema |
getDelegate() |
int |
hashCode() |
static JsonSchema |
newInstance(JsonSchema arg) |
static JsonSchema |
of(boolean bool)
Factory method to create a
JsonSchema from a Boolean . |
static JsonSchema |
of(JsonObject json)
Factory method to create a
JsonSchema from a . |
static JsonSchema |
of(String id,
JsonObject json)
Factory method to create a
JsonSchema from a . |
JsonObject |
resolve()
Tries to resolve all internal references.
|
String |
toString() |
public static final io.vertx.lang.rx.TypeArg<JsonSchema> __TYPE_ARG
public static final java.util.function.Predicate<String> EXCLUDE_ANNOTATIONS
public static final java.util.function.Predicate<Map.Entry<String,Object>> EXCLUDE_ANNOTATION_ENTRIES
public JsonSchema(JsonSchema delegate)
public JsonSchema(Object delegate)
public JsonSchema getDelegate()
public static JsonSchema of(JsonObject json)
JsonSchema
from a .json
- a JSON Object.public static JsonSchema of(String id, JsonObject json)
JsonSchema
from a .id
- will force the given id as the schema $id.json
- a JSON Object.public static JsonSchema of(boolean bool)
JsonSchema
from a Boolean
.bool
- a boolean.public JsonSchema annotate(String key, String value)
key
- a keyvalue
- a valuepublic <R> R get(String key)
key
- a keynull
public <R> R get(String key, R fallback)
key
- a keyfallback
- fallback when key is not presentnull
public boolean containsKey(String key)
key
- a keytrue
if presentpublic Set<String> fieldNames()
public JsonObject resolve()
The result is an object where all references have been resolved. Resolution of circular references is shallow. This should normally not be a problem for this use case.
$ref
s replaced by their value.public static JsonSchema newInstance(JsonSchema arg)
Copyright © 2024 Eclipse. All rights reserved.