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 classSchema.BuilderA builder class forSchemainstances.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)static SchemafromAnnotation(Schema schema, ApiDescription descriptor, Class<?> relativeType)Builds Schema object from the data in the annotation parameter.abstract ReferencegetReference()Getter for reference.abstract JsonValuegetSchema()Obtain the schema definition if it is not a reference.inthashCode()static Schema.BuildernewBuilder()Create a new Builder for Schema.static Schema.Builderschema()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 theschemahas aniddefined, or if the type being used for the schema definition has aniddefined, 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
-
-