public class JsonSchemaProperty extends Object
Modifier and Type | Field and Description |
---|---|
static JsonSchemaProperty |
ARRAY
A property with key "type" and value "array".
|
static JsonSchemaProperty |
BOOLEAN
A property with key "type" and value "boolean".
|
static JsonSchemaProperty |
INTEGER
A property with key "type" and value "integer".
|
static JsonSchemaProperty |
NULL
A property with key "type" and value "null".
|
static JsonSchemaProperty |
NUMBER
A property with key "type" and value "number".
|
static JsonSchemaProperty |
OBJECT
A property with key "type" and value "object".
|
static JsonSchemaProperty |
STRING
A property with key "type" and value "string".
|
Constructor and Description |
---|
JsonSchemaProperty(String key,
Object value)
Construct a property with key and value.
|
Modifier and Type | Method and Description |
---|---|
static JsonSchemaProperty |
description(String value)
Construct a property with key "description" and value.
|
static JsonSchemaProperty |
enums(Class<?> enumClass)
Construct a property with key "enum" and values taken from enumClass.
|
static JsonSchemaProperty |
enums(Object... enumValues)
Construct a property with key "enum" and value enumValues.
|
static JsonSchemaProperty |
enums(String... enumValues)
Construct a property with key "enum" and value enumValues.
|
boolean |
equals(Object another) |
static JsonSchemaProperty |
from(String key,
Object value)
Construct a property with key and value.
|
int |
hashCode() |
static JsonSchemaProperty |
items(JsonSchemaProperty type)
Wraps the given type in a property with key "items".
|
String |
key()
Get the key.
|
static JsonSchemaProperty |
property(String key,
Object value)
Construct a property with key and value.
|
String |
toString() |
static JsonSchemaProperty |
type(String value)
Construct a property with key "type" and value.
|
Object |
value()
Get the value.
|
public static final JsonSchemaProperty STRING
public static final JsonSchemaProperty INTEGER
public static final JsonSchemaProperty NUMBER
public static final JsonSchemaProperty OBJECT
public static final JsonSchemaProperty ARRAY
public static final JsonSchemaProperty BOOLEAN
public static final JsonSchemaProperty NULL
public String key()
public Object value()
public static JsonSchemaProperty from(String key, Object value)
Equivalent to new JsonSchemaProperty(key, value)
.
key
- the key.value
- the value.public static JsonSchemaProperty property(String key, Object value)
Equivalent to new JsonSchemaProperty(key, value)
.
key
- the key.value
- the value.public static JsonSchemaProperty type(String value)
Equivalent to new JsonSchemaProperty("type", value)
.
value
- the value.public static JsonSchemaProperty description(String value)
Equivalent to new JsonSchemaProperty("description", value)
.
value
- the value.public static JsonSchemaProperty enums(String... enumValues)
enumValues
- enum valuespublic static JsonSchemaProperty enums(Object... enumValues)
Verifies that each value is a java class.
enumValues
- enum valuespublic static JsonSchemaProperty enums(Class<?> enumClass)
enumClass
- enum classpublic static JsonSchemaProperty items(JsonSchemaProperty type)
type
- the typeCopyright © 2024. All rights reserved.