Class JsonSchemaProperty
-
- All Implemented Interfaces:
@Deprecated(forRemoval = true) public class JsonSchemaProperty
Represents a property in a JSON schema.
-
-
Field Summary
Fields Modifier and Type Field Description public final static JsonSchemaProperty
STRING
public final static JsonSchemaProperty
INTEGER
public final static JsonSchemaProperty
NUMBER
public final static JsonSchemaProperty
OBJECT
public final static JsonSchemaProperty
ARRAY
public final static JsonSchemaProperty
BOOLEAN
public final static JsonSchemaProperty
NULL
-
Constructor Summary
Constructors Constructor Description JsonSchemaProperty(String key, Object value)
Construct a property with key and value.
-
Method Summary
Modifier and Type Method Description String
key()
Get the key. Object
value()
Get the value. boolean
equals(Object another)
int
hashCode()
String
toString()
static JsonSchemaProperty
from(String key, Object value)
Construct a property with key and value. static JsonSchemaProperty
property(String key, Object value)
Construct a property with key and value. static JsonSchemaProperty
type(String value)
Construct a property with key "type" and value. static JsonSchemaProperty
description(String value)
Construct a property with key "description" and value. static JsonSchemaProperty
enums(Array<String> enumValues)
Construct a property with key "enum" and value enumValues. static JsonSchemaProperty
enums(Array<Object> enumValues)
Construct a property with key "enum" and value enumValues. static JsonSchemaProperty
enums(Class<out Object> enumClass)
Construct a property with key "enum" and all enum values taken from enumClass. static JsonSchemaProperty
items(JsonSchemaProperty type)
Wraps the given type in a property with key "items". static JsonSchemaProperty
objectItems(JsonSchemaProperty type)
-
-
Method Detail
-
hashCode
int hashCode()
-
from
@Deprecated(forRemoval = true) static JsonSchemaProperty from(String key, Object value)
Construct a property with key and value.
Equivalent to
new JsonSchemaProperty(key, value)
.- Parameters:
key
- the key.value
- the value.- Returns:
a property with key and value.
-
property
@Deprecated(forRemoval = true) static JsonSchemaProperty property(String key, Object value)
Construct a property with key and value.
Equivalent to
new JsonSchemaProperty(key, value)
.- Parameters:
key
- the key.value
- the value.- Returns:
a property with key and value.
-
type
@Deprecated(forRemoval = true) static JsonSchemaProperty type(String value)
Construct a property with key "type" and value.
Equivalent to
new JsonSchemaProperty("type", value)
.- Parameters:
value
- the value.- Returns:
a property with key and value.
-
description
@Deprecated(forRemoval = true) static JsonSchemaProperty description(String value)
Construct a property with key "description" and value.
Equivalent to
new JsonSchemaProperty("description", value)
.- Parameters:
value
- the value.- Returns:
a property with key and value.
-
enums
@Deprecated(forRemoval = true) static JsonSchemaProperty enums(Array<String> enumValues)
Construct a property with key "enum" and value enumValues.
- Parameters:
enumValues
- enum values as strings.- Returns:
a property with key "enum" and value enumValues
-
enums
@Deprecated(forRemoval = true) static JsonSchemaProperty enums(Array<Object> enumValues)
Construct a property with key "enum" and value enumValues.
Verifies that each value is a java class.
- Parameters:
enumValues
- enum values.- Returns:
a property with key "enum" and value enumValues
-
enums
@Deprecated(forRemoval = true) static JsonSchemaProperty enums(Class<out Object> enumClass)
Construct a property with key "enum" and all enum values taken from enumClass.
- Parameters:
enumClass
- enum class.- Returns:
a property with key "enum" and values taken from enumClass
-
items
@Deprecated(forRemoval = true) static JsonSchemaProperty items(JsonSchemaProperty type)
Wraps the given type in a property with key "items".
- Parameters:
type
- the type- Returns:
a property with key "items" and value type.
-
objectItems
@Deprecated(forRemoval = true) static JsonSchemaProperty objectItems(JsonSchemaProperty type)
-
-
-
-