T
- the model's typeS
- the type of the model's identifier (e.g., Long
, String
, etc.)U
- the type of the resource's identifier. It must be a subclass of
Identifier<S>
.@ConsumerType public interface CollectionResource<T,S,U extends Identifier<S>> extends ItemResource<T,S,U>, CollectionRouter<T,S,U>
Resources behave like an API, so you must add the API's name via the Representable.getName()
method.
The type param provided for the resource ID must be unique in the whole application.
Representors created by the Representable.representor(com.liferay.apio.architect.representor.Representor.Builder)
method hold all the information needed to write your domain models'
hypermedia representations.
You can add the different supported routes for the collection resource via
the CollectionRouter.collectionRoutes(
com.liferay.apio.architect.routes.CollectionRoutes.Builder)
method.
You can add the different supported routes for the single resource via the
ItemRouter.itemRoutes(com.liferay.apio.architect.routes.ItemRoutes.Builder)
method.
getName, representor
itemRoutes
collectionRoutes