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 Representable<T,S,U extends Identifier<S>>
The type parameter provided for the resource ID must be unique in the application.
Representors created by the representor(Representor.Builder)
method
hold all the information needed to write your domain models' hypermedia
representations.
The union of an instance of this interface and one or more routers from the
com.liferay.apio.architect.router
package (such as ItemRouter
) creates a complete resource
that behaves as its own API.
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getName()
Returns the resource's name.
|
Representor<T> |
representor(Representor.Builder<T,S> builder)
Creates a
Representor for a certain domain model from the
provided Representor.Builder . |
java.lang.String getName()
Representor<T> representor(Representor.Builder<T,S> builder)
Representor
for a certain domain model from the
provided Representor.Builder
.
To construct a representor, you must call BaseRepresentor.BaseFirstStep.build()
()}. Before calling this method, you must
call the other representor builder methods to populate the builder with
data. This ensures that the resulting representor contains the data.
builder
- the representor builder used to create the representorRepresentor.Builder