Package org.forgerock.api.models
Class Resource
- java.lang.Object
 - 
- org.forgerock.api.models.Resource
 
 
- 
public final class Resource extends Object
Class that represents the Resource type in API descriptor.Resources may be either a reference to anotherResourcethat will be defined elsewhere in the API Descriptor, or a described resource. If aReferenceis provided, then none of the other fields may be used, and if any of the other fields are used, a reference may not be provided. 
- 
- 
Nested Class Summary
Nested Classes Modifier and Type Class Description static classResource.AnnotatedTypeVariantThe variant of the annotated type.static classResource.BuilderBuilder to help construct the Resource. 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)static ResourcefromAnnotatedType(Class<?> type, Resource.AnnotatedTypeVariant variant, ApiDescription descriptor)Build aResourcefrom an annotated request handler.static ResourcefromAnnotatedType(Class<?> type, Resource.AnnotatedTypeVariant variant, Items items, ApiDescription descriptor, Parameter... extraParameters)Build aResourcefrom an annotated request handler.static ResourcefromAnnotatedType(Class<?> type, Resource.AnnotatedTypeVariant variant, SubResources subResources, ApiDescription descriptor, Parameter... extraParameters)Build aResourcefrom an annotated request handler.Action[]getActions()Getter of actions.CreategetCreate()Getter of Create.DeletegetDelete()Getter of Delete.LocalizableStringgetDescription()Getter of description.ItemsgetItems()Getter of items.Parameter[]getParameters()Getter of the parameters array.PatchgetPatch()Getter of Patch.Query[]getQueries()Getter of queries.ReadgetRead()Getter of Read.ReferencegetReference()Gets the reference.SchemagetResourceSchema()Getter of resource schema.SubResourcesgetSubresources()Getter of sub-resources.LocalizableStringgetTitle()Getter of title.UpdategetUpdate()Getter of Update.inthashCode()BooleanisMvccSupported()Informs if MVCC is supported.static Resource.Builderresource()Create a new Builder for Resoruce.StringtoString() 
 - 
 
- 
- 
Method Detail
- 
getResourceSchema
public Schema getResourceSchema()
Getter of resource schema.- Returns:
 - Resource schema
 
 
- 
getTitle
public LocalizableString getTitle()
Getter of title.- Returns:
 - Title
 
 
- 
getDescription
public LocalizableString getDescription()
Getter of description.- Returns:
 - Description
 
 
- 
getCreate
public Create getCreate()
Getter of Create.- Returns:
 - Create
 
 
- 
getRead
public Read getRead()
Getter of Read.- Returns:
 - Read
 
 
- 
getUpdate
public Update getUpdate()
Getter of Update.- Returns:
 - Update
 
 
- 
getDelete
public Delete getDelete()
Getter of Delete.- Returns:
 - Delete
 
 
- 
getPatch
public Patch getPatch()
Getter of Patch.- Returns:
 - Patch
 
 
- 
getActions
public Action[] getActions()
Getter of actions.- Returns:
 - Actions
 
 
- 
getQueries
public Query[] getQueries()
Getter of queries.- Returns:
 - Queries
 
 
- 
getSubresources
public SubResources getSubresources()
Getter of sub-resources.- Returns:
 - Sub-resources
 
 
- 
getReference
public Reference getReference()
Gets the reference.- Returns:
 - The reference.
 
 
- 
getItems
public Items getItems()
Getter of items.- Returns:
 - Items
 
 
- 
isMvccSupported
public Boolean isMvccSupported()
Informs if MVCC is supported.- Returns:
 trueif MVCC is supported andfalseotherwise
 
- 
getParameters
public Parameter[] getParameters()
Getter of the parameters array.- Returns:
 - Parameters
 
 
- 
resource
public static Resource.Builder resource()
Create a new Builder for Resoruce.- Returns:
 - Builder
 
 
- 
fromAnnotatedType
public static Resource fromAnnotatedType(Class<?> type, Resource.AnnotatedTypeVariant variant, ApiDescription descriptor)
Build aResourcefrom an annotated request handler.- Parameters:
 type- The annotated type.variant- The annotated type variant.descriptor- The root descriptor to add definitions to.- Returns:
 - The built 
Resourceobject. 
 
- 
fromAnnotatedType
public static Resource fromAnnotatedType(Class<?> type, Resource.AnnotatedTypeVariant variant, SubResources subResources, ApiDescription descriptor, Parameter... extraParameters)
Build aResourcefrom an annotated request handler.- Parameters:
 type- The annotated type.variant- The annotated type variant.subResources- The sub resources object to be included, if any sub-resources exist, or null.descriptor- The root descriptor to add definitions to.extraParameters- Extra parameters not from the resource annotation.- Returns:
 - The built 
Resourceobject. 
 
- 
fromAnnotatedType
public static Resource fromAnnotatedType(Class<?> type, Resource.AnnotatedTypeVariant variant, Items items, ApiDescription descriptor, Parameter... extraParameters)
Build aResourcefrom an annotated request handler.- Parameters:
 type- The annotated type.variant- The annotated type variant.items- The items definition for a collection variant, or null.descriptor- The root descriptor to add definitions to.extraParameters- Extra parameters not from the resource annotation.- Returns:
 - The built 
Resourceobject. 
 
 - 
 
 -