public class CombinedSchema extends Schema
allOf
, oneOf
, anyOf
schemas.Modifier and Type | Class and Description |
---|---|
static class |
CombinedSchema.Builder
Builder class for
CombinedSchema . |
static interface |
CombinedSchema.ValidationCriterion
Validation criterion.
|
Modifier and Type | Field and Description |
---|---|
static CombinedSchema.ValidationCriterion |
ALL_CRITERION
Validation criterion for
allOf schemas. |
static CombinedSchema.ValidationCriterion |
ANY_CRITERION
Validation criterion for
anyOf schemas. |
static CombinedSchema.ValidationCriterion |
ONE_CRITERION
Validation criterion for
oneOf schemas. |
schemaLocation
Constructor and Description |
---|
CombinedSchema(CombinedSchema.Builder builder)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static CombinedSchema.Builder |
allOf(Collection<Schema> schemas) |
static CombinedSchema.Builder |
anyOf(Collection<Schema> schemas) |
static CombinedSchema.Builder |
builder() |
static CombinedSchema.Builder |
builder(Collection<Schema> subschemas) |
protected boolean |
canEqual(Object other)
Since we add state in subclasses, but want those subclasses to be non final, this allows us to
have equals methods that satisfy the equals contract.
|
boolean |
definesProperty(String field)
Determines if this
Schema instance defines any restrictions for the object property
denoted by field . |
boolean |
equals(Object o) |
CombinedSchema.ValidationCriterion |
getCriterion() |
Collection<Schema> |
getSubschemas() |
int |
hashCode() |
static CombinedSchema.Builder |
oneOf(Collection<Schema> schemas) |
describeTo, failure, failure, getDefaultValue, getDescription, getId, getLocation, getSchemaLocation, getTitle, getUnprocessedProperties, hasDefaultValue, isNullable, isReadOnly, isWriteOnly, toString, validate
public static final CombinedSchema.ValidationCriterion ALL_CRITERION
allOf
schemas.public static final CombinedSchema.ValidationCriterion ANY_CRITERION
anyOf
schemas.public static final CombinedSchema.ValidationCriterion ONE_CRITERION
oneOf
schemas.public CombinedSchema(CombinedSchema.Builder builder)
builder
- the builder containing the validation criterion and the subschemas to be checkedpublic static CombinedSchema.Builder allOf(Collection<Schema> schemas)
public static CombinedSchema.Builder anyOf(Collection<Schema> schemas)
public static CombinedSchema.Builder builder()
public static CombinedSchema.Builder builder(Collection<Schema> subschemas)
public static CombinedSchema.Builder oneOf(Collection<Schema> schemas)
public CombinedSchema.ValidationCriterion getCriterion()
public Collection<Schema> getSubschemas()
public boolean definesProperty(String field)
Schema
Schema
instance defines any restrictions for the object property
denoted by field
. The field
should be a JSON pointer, denoting the property to
be queried.
For example the field "#/rectangle/a"
is defined by the following schema:
objectWithSchemaRectangleDep" : {
"type" : "object",
"dependencies" : {
"d" : {
"type" : "object",
"properties" : {
"rectangle" : {"$ref" : "#/definitions/Rectangle" }
}
}
},
"definitions" : {
"size" : {
"type" : "number",
"minimum" : 0
},
"Rectangle" : {
"type" : "object",
"properties" : {
"a" : {"$ref" : "#/definitions/size"},
"b" : {"$ref" : "#/definitions/size"}
}
}
}
}
The default implementation of this method always returns false.definesProperty
in class Schema
field
- should be a JSON pointer in its string representation.true
if the propertty denoted by field
is defined by this schema
instanceCopyright © 2019 Everit Kft.. All rights reserved.