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 ItemResource<T,S,U extends Identifier<S>> extends Representable<T,S,U>, ItemRouter<T,S,U>
Resources behave like an API, so you must add the API's name via the Representable.getName()
method.
The type parameter provided for the resource ID must be unique in the application.
Representors created by the method Representable.representor(com.liferay.apio.architect.representor.Representor.Builder)
hold all the information needed to write your domain models' hypermedia
representations.
You can add the different supported routes via the method ItemRouter.itemRoutes(com.liferay.apio.architect.routes.ItemRoutes.Builder)
.
Representor.Builder
,
ItemRoutes.Builder
getName, representor
itemRoutes