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
Nested ClassesModifier and TypeClassDescriptionstatic final classA builder class forSchemainstances. -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic SchemafromAnnotation(Schema schema, ApiDescription descriptor, Class<?> relativeType) Builds Schema object from the data in the annotation parameter.abstract ReferenceGetter for reference.abstract JsonValueObtain the schema definition if it is not a reference.inthashCode()static Schema.BuilderCreate a new Builder for Schema.static Schema.Builderschema()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 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
-