- java.lang.Object
-
- java.lang.Enum<SpecVersion>
-
- org.leadpony.justify.api.SpecVersion
-
- All Implemented Interfaces:
Serializable,Comparable<SpecVersion>
public enum SpecVersion extends Enum<SpecVersion>
The versions of the JSON Schema Specification.- Author:
- leadpony
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SpecVersioncurrent()Returns the current stable version.static SpecVersiongetById(URI id)Returns the version of the specified ID.URIid()Returns the identifier of this version, such as"http://json-schema.org/draft-07/schema#".static SpecVersionvalueOf(String name)Returns the enum constant of this type with the specified name.static SpecVersion[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
DRAFT_04
public static final SpecVersion DRAFT_04
JSON Schema specification of Draft-04.
-
DRAFT_06
public static final SpecVersion DRAFT_06
JSON Schema specification of Draft-06.
-
DRAFT_07
public static final SpecVersion DRAFT_07
JSON Schema specification of Draft-07.
-
-
Method Detail
-
values
public static SpecVersion[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (SpecVersion c : SpecVersion.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static SpecVersion valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
id
public URI id()
Returns the identifier of this version, such as"http://json-schema.org/draft-07/schema#".- Returns:
- the identifier of this version, never be
null.
-
current
public static SpecVersion current()
Returns the current stable version.- Returns:
- the current stable version.
-
getById
public static SpecVersion getById(URI id)
Returns the version of the specified ID.- Parameters:
id- the identifier of the version, such as"http://json-schema.org/draft-07/schema#".- Returns:
- found version, never be
null. - Throws:
IllegalArgumentException- if this enum type has no constant with the specified identifier.NullPointerException- if the specifiedidisnull.
-
-