Class UnionTypeSchema
- java.lang.Object
-
- com.fasterxml.jackson.module.jsonSchema.jakarta.JsonSchema
-
- com.fasterxml.jackson.module.jsonSchema.jakarta.types.UnionTypeSchema
-
public class UnionTypeSchema extends JsonSchema
This class represents aJsonSchema
as a Union Type Schema: "An array of two or more simple type definitions. Each item in the array MUST be a simple type definition or a schema. The instance value is valid if it is of the same type as one of the simple type definitions, or valid by one of the schemas, in
-
-
Field Summary
Fields Modifier and Type Field Description protected ValueTypeSchema[]
elements
-
Constructor Summary
Constructors Constructor Description UnionTypeSchema()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
_equals(UnionTypeSchema that)
UnionTypeSchema
asUnionTypeSchema()
Attempt to return this JsonSchema as anUnionTypeSchema
boolean
equals(java.lang.Object obj)
ValueTypeSchema[]
getElements()
com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatTypes
getType()
boolean
isUnionTypeSchema()
determine if this JsonSchema is anUnionTypeSchema
.void
setElements(ValueTypeSchema[] elements)
-
Methods inherited from class com.fasterxml.jackson.module.jsonSchema.jakarta.JsonSchema
_equals, arraysEqual, asAnySchema, asArraySchema, asBooleanSchema, asContainerSchema, asContainerTypeSchema, asIntegerSchema, asNullSchema, asNumberSchema, asObjectSchema, asSimpleTypeSchema, asStringSchema, asValueSchemaSchema, asValueTypeSchema, enrichWithBeanProperty, equals, get$ref, get$schema, getDescription, getDisallow, getExtends, getId, getReadonly, getRequired, isAnySchema, isArraySchema, isBooleanSchema, isContainerTypeSchema, isIntegerSchema, isNullSchema, isNumberSchema, isObjectSchema, isSimpleTypeSchema, isStringSchema, isValueTypeSchema, minimalForFormat, set$ref, set$schema, setDescription, setDisallow, setExtends, setId, setReadonly, setRequired
-
-
-
-
Field Detail
-
elements
protected ValueTypeSchema[] elements
-
-
Method Detail
-
isUnionTypeSchema
public boolean isUnionTypeSchema()
Description copied from class:JsonSchema
determine if this JsonSchema is anUnionTypeSchema
.- Overrides:
isUnionTypeSchema
in classJsonSchema
- Returns:
- true if this JsonSchema is an UnionTypeSchema, false otherwise
-
asUnionTypeSchema
public UnionTypeSchema asUnionTypeSchema()
Description copied from class:JsonSchema
Attempt to return this JsonSchema as anUnionTypeSchema
- Overrides:
asUnionTypeSchema
in classJsonSchema
- Returns:
- this as a UnionTypeSchema if possible, or null otherwise
-
getType
public com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatTypes getType()
- Specified by:
getType
in classJsonSchema
-
getElements
public ValueTypeSchema[] getElements()
-
setElements
public void setElements(ValueTypeSchema[] elements)
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classJsonSchema
-
_equals
protected boolean _equals(UnionTypeSchema that)
-
-