Class ObjectSchema.Builder

    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • additionalProperties

        public ObjectSchema.Builder additionalProperties​(boolean additionalProperties)
      • addPropertySchema

        public ObjectSchema.Builder addPropertySchema​(java.lang.String propName,
                                                      Schema schema)
        Adds a property schema.
        Parameters:
        propName - the name of the property which' expected schema must be schema
        schema - if the subject under validation has a property named propertyName then its value will be validated using this schema
        Returns:
        this
      • addRequiredProperty

        public ObjectSchema.Builder addRequiredProperty​(java.lang.String propertyName)
      • patternProperty

        @Deprecated
        public ObjectSchema.Builder patternProperty​(java.util.regex.Pattern pattern,
                                                    Schema schema)
        Deprecated.
      • patternProperty

        @Deprecated
        public ObjectSchema.Builder patternProperty​(java.lang.String pattern,
                                                    Schema schema)
        Deprecated.
      • propertyDependency

        public ObjectSchema.Builder propertyDependency​(java.lang.String ifPresent,
                                                       java.lang.String mustBePresent)
        Adds a property dependency.
        Parameters:
        ifPresent - the name of the property which if is present then a property with name mustBePresent is mandatory
        mustBePresent - a property with this name must exist in the subject under validation if a property named ifPresent exists
        Returns:
        this
      • schemaOfAdditionalProperties

        public ObjectSchema.Builder schemaOfAdditionalProperties​(Schema schemaOfAdditionalProperties)