Class SchemaRouter
- java.lang.Object
-
- io.vertx.mutiny.json.schema.SchemaRouter
-
public class SchemaRouter extends Object
Represents a pool where parsed schemas are addressed and cached.
It also contains a cache of including on top or inner level some json schemas that could eventually parsed later.
You should not share this object between different threads
NOTE: This class has been automatically generated from theoriginal
non Mutiny-ified interface using Vert.x codegen.
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<SchemaRouter>
__TYPE_ARG
-
Constructor Summary
Constructors Constructor Description SchemaRouter(io.vertx.json.schema.SchemaRouter delegate)
SchemaRouter(Object delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SchemaRouter
addJson(String uri, io.vertx.core.json.JsonObject object)
SchemaRouter
addJson(URI uri, io.vertx.core.json.JsonObject object)
SchemaRouter
addSchema(Schema schema, io.vertx.core.json.pointer.JsonPointer[] aliasScopes)
SchemaRouter
addSchemaAlias(Schema schema, String alias)
SchemaRouter
addSchemaWithScope(Schema schema, JsonPointer scope)
static SchemaRouter
create(HttpClient client, FileSystem fs, io.vertx.json.schema.SchemaRouterOptions schemaRouterOptions)
static SchemaRouter
create(Vertx vertx, io.vertx.json.schema.SchemaRouterOptions schemaRouterOptions)
boolean
equals(Object o)
io.vertx.json.schema.SchemaRouter
getDelegate()
int
hashCode()
static SchemaRouter
newInstance(io.vertx.json.schema.SchemaRouter arg)
List<Schema>
registeredSchemas()
Schema
resolveCachedSchema(JsonPointer refPointer, JsonPointer schemaScope, SchemaParser parser)
io.smallrye.mutiny.Uni<Schema>
resolveRef(JsonPointer pointer, JsonPointer scope, SchemaParser schemaParser)
Schema
resolveRefAndAwait(JsonPointer pointer, JsonPointer scope, SchemaParser schemaParser)
void
resolveRefAndForget(JsonPointer pointer, JsonPointer scope, SchemaParser schemaParser)
Variant ofresolveRef(io.vertx.mutiny.core.json.pointer.JsonPointer,io.vertx.mutiny.core.json.pointer.JsonPointer,io.vertx.mutiny.json.schema.SchemaParser)
that ignores the result of the operation.String
toString()
-
-
-
Field Detail
-
__TYPE_ARG
public static final TypeArg<SchemaRouter> __TYPE_ARG
-
-
Constructor Detail
-
SchemaRouter
public SchemaRouter(io.vertx.json.schema.SchemaRouter delegate)
-
SchemaRouter
public SchemaRouter(Object delegate)
-
-
Method Detail
-
getDelegate
public io.vertx.json.schema.SchemaRouter getDelegate()
-
resolveCachedSchema
public Schema resolveCachedSchema(JsonPointer refPointer, JsonPointer schemaScope, SchemaParser parser)
- Parameters:
refPointer
-schemaScope
-parser
-- Returns:
- the resolved schema, or null if no schema was found
-
resolveRef
public io.smallrye.mutiny.Uni<Schema> resolveRef(JsonPointer pointer, JsonPointer scope, SchemaParser schemaParser)
LikeresolveRef(io.vertx.mutiny.core.json.pointer.JsonPointer, io.vertx.mutiny.core.json.pointer.JsonPointer, io.vertx.mutiny.json.schema.SchemaParser)
but with a direct callback.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
pointer
-scope
-schemaParser
-- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
resolveRefAndAwait
public Schema resolveRefAndAwait(JsonPointer pointer, JsonPointer scope, SchemaParser schemaParser)
Blocking variant ofresolveRef(io.vertx.mutiny.core.json.pointer.JsonPointer,io.vertx.mutiny.core.json.pointer.JsonPointer,io.vertx.mutiny.json.schema.SchemaParser)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
pointer
-scope
-schemaParser
-- Returns:
- the Schema instance produced by the operation.
-
resolveRefAndForget
public void resolveRefAndForget(JsonPointer pointer, JsonPointer scope, SchemaParser schemaParser)
Variant ofresolveRef(io.vertx.mutiny.core.json.pointer.JsonPointer,io.vertx.mutiny.core.json.pointer.JsonPointer,io.vertx.mutiny.json.schema.SchemaParser)
that ignores the result of the operation.This method subscribes on the result of
resolveRef(io.vertx.mutiny.core.json.pointer.JsonPointer,io.vertx.mutiny.core.json.pointer.JsonPointer,io.vertx.mutiny.json.schema.SchemaParser)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromresolveRef(io.vertx.mutiny.core.json.pointer.JsonPointer,io.vertx.mutiny.core.json.pointer.JsonPointer,io.vertx.mutiny.json.schema.SchemaParser)
but you don't need to compose it with other operations.- Parameters:
pointer
-scope
-schemaParser
-
-
addSchemaWithScope
public SchemaRouter addSchemaWithScope(Schema schema, JsonPointer scope)
- Parameters:
schema
- schema to addscope
-- Returns:
- a reference to this
-
addSchemaAlias
public SchemaRouter addSchemaAlias(Schema schema, String alias)
- Parameters:
schema
- schema to addalias
- the schema alias- Returns:
- a reference to this
-
addJson
public SchemaRouter addJson(String uri, io.vertx.core.json.JsonObject object)
- Parameters:
uri
-object
-- Returns:
- a reference to this
-
create
public static SchemaRouter create(Vertx vertx, io.vertx.json.schema.SchemaRouterOptions schemaRouterOptions)
- Parameters:
vertx
-schemaRouterOptions
-- Returns:
-
create
public static SchemaRouter create(HttpClient client, FileSystem fs, io.vertx.json.schema.SchemaRouterOptions schemaRouterOptions)
- Parameters:
client
-fs
-schemaRouterOptions
-- Returns:
-
addSchema
public SchemaRouter addSchema(Schema schema, io.vertx.core.json.pointer.JsonPointer[] aliasScopes)
- Parameters:
schema
- schema to addaliasScopes
-- Returns:
- a reference to this
-
addJson
public SchemaRouter addJson(URI uri, io.vertx.core.json.JsonObject object)
- Parameters:
uri
-object
-- Returns:
- a reference to this
-
newInstance
public static SchemaRouter newInstance(io.vertx.json.schema.SchemaRouter arg)
-
-