Package org.forgerock.api.models
Class Schema
- java.lang.Object
-
- org.forgerock.api.models.Schema
-
public abstract class Schema extends Object
Class that represents the Schema type in API descriptor.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Schema.Builder
A builder class forSchema
instances.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
static Schema
fromAnnotation(Schema schema, ApiDescription descriptor, Class<?> relativeType)
Builds Schema object from the data in the annotation parameter.abstract Reference
getReference()
Getter for reference.abstract JsonValue
getSchema()
Obtain the schema definition if it is not a reference.int
hashCode()
static Schema.Builder
newBuilder()
Create a new Builder for Schema.static Schema.Builder
schema()
Create a new Builder for Schema.
-
-
-
Method Detail
-
getReference
public abstract Reference getReference()
Getter for reference. May be null if the schema is specified here.- Returns:
- The reference.
-
getSchema
public abstract JsonValue getSchema()
Obtain the schema definition if it is not a reference.- Returns:
- The schema.
-
newBuilder
public static Schema.Builder newBuilder()
Create a new Builder for Schema.- Returns:
- The builder.
-
schema
public static Schema.Builder schema()
Create a new Builder for Schema. A synonym fornewBuilder()
that is useful for static imports.- Returns:
- The builder.
-
fromAnnotation
public static Schema fromAnnotation(Schema schema, ApiDescription descriptor, Class<?> relativeType)
Builds Schema object from the data in the annotation parameter. If theschema
has anid
defined, or if the type being used for the schema definition has anid
defined, the schema will be defined in the top-leveldescriptor
, and a reference to that definition will be returned.- Parameters:
schema
- The annotation that holds the datadescriptor
- The root descriptor to add definitions to.relativeType
- The type relative to which schema resources should be resolved.- Returns:
- Schema instance
-
-