Class Validator

java.lang.Object
io.vertx.mutiny.json.schema.Validator
All Implemented Interfaces:
MutinyDelegate

public class Validator extends Object implements MutinyDelegate
A validator, validates some input object using a well known schema.

NOTE: This class has been automatically generated from the original non Mutiny-ified interface.

Author:
Paulo Lopes
See Also:
  • Validator
  • Field Details

  • Constructor Details

    • Validator

      public Validator(io.vertx.json.schema.Validator delegate)
      Create a new instance of Validator delegating to the given (non-null) instance of Validator.
    • Validator

      public Validator(Object delegate)
  • Method Details

    • getDelegate

      public io.vertx.json.schema.Validator getDelegate()
      Get the delegate instance.

      This method returns the instance on which this shim is delegating the calls. And so, give you access to the bare API.

      Specified by:
      getDelegate in interface MutinyDelegate
      Returns:
      the delegate instance
    • create

      public static Validator create(JsonSchema schema, io.vertx.json.schema.JsonSchemaOptions options)
      Creates a new validator with some initial schema and options.

      When validation is to be reused, it is recommended to create a SchemaRepository instance and use the SchemaRepository.validator(String)} method. The use of a String key allows avoiding re-parsing and fast lookups.

      Parameters:
      schema - the initial schema
      options - the validator options
      Returns:
      a validator instance
    • create

      public static Validator create(JsonSchema schema, io.vertx.json.schema.JsonSchemaOptions options, JsonFormatValidator jsonFormatValidator)
      Creates a new validator with some initial schema, options and a custom JSON format validator. When validation is to be reused, it is recommended to create a SchemaRepository instance and use the SchemaRepository.validator(String)} method. The use of a String key allows avoiding re-parsing and fast lookups.
      Parameters:
      schema - the initial schema
      options - the validator options
      jsonFormatValidator - the custom JSON format validator
      Returns:
      a validator instance
    • validate

      public io.vertx.json.schema.OutputUnit validate(Object instance) throws io.vertx.json.schema.SchemaException
      Validate a given input against the initial schema.
      Parameters:
      instance - instance to validate
      Returns:
      returns a output unit object as defined by the options
      Throws:
      io.vertx.json.schema.SchemaException
    • newInstance

      public static Validator newInstance(io.vertx.json.schema.Validator delegate)
      Creates a new instance of the Validator.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object