Package org.forgerock.api.models
Class Schema
java.lang.Object
org.forgerock.api.models.Schema
Class that represents the Schema type in API descriptor.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
A builder class forSchema
instances. -
Method Summary
Modifier and TypeMethodDescriptionboolean
static Schema
fromAnnotation
(Schema schema, ApiDescription descriptor, Class<?> relativeType) Builds Schema object from the data in the annotation parameter.abstract Reference
Getter for reference.abstract JsonValue
Obtain the schema definition if it is not a reference.int
hashCode()
static Schema.Builder
Create a new Builder for Schema.static Schema.Builder
schema()
Create a new Builder for Schema.
-
Method Details
-
getReference
Getter for reference. May be null if the schema is specified here.- Returns:
- The reference.
-
getSchema
Obtain the schema definition if it is not a reference.- Returns:
- The schema.
-
equals
-
hashCode
public int hashCode() -
newBuilder
Create a new Builder for Schema.- Returns:
- The 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
-