TypedRest for Java
Public Member Functions | List of all members
net.typedrest.Endpoint Interface Reference

REST endpoint, i.e. More...

Inheritance diagram for net.typedrest.Endpoint:
net.typedrest.AbstractEndpoint net.typedrest.BlobEndpoint net.typedrest.ElementEndpoint< TEntity > net.typedrest.GenericCollectionEndpoint< TEntity, TElementEndpoint extends Endpoint > net.typedrest.TriggerEndpoint net.typedrest.AbstractETagEndpoint net.typedrest.AbstractTriggerEndpoint net.typedrest.BlobEndpointImpl net.typedrest.EntryEndpoint net.typedrest.BlobEndpointImpl net.typedrest.ElementEndpointImpl< TEntity > net.typedrest.PollingEndpoint< TEntity > net.typedrest.AbstractTriggerEndpoint net.typedrest.ActionEndpoint net.typedrest.ConsumerEndpoint< TEntity > net.typedrest.FunctionEndpoint< TEntity, TResult > net.typedrest.SupplierEndpoint< TResult >

Public Member Functions

URI getUri ()
 The HTTP URI of the remote resource. More...
 
Executor getExecutor ()
 The REST executor used to communicate with the remote resource. More...
 
ObjectMapper getSerializer ()
 Controls the serialization of entities sent to and received from the server. More...
 
Set< URI > getLinks (String rel)
 Retrieves all links with a specific relation type cached from the last request. More...
 
Map< URI, String > getLinksWithTitles (String rel)
 Retrieves all links (with titles) with a specific relation type cached from the last request. More...
 
URI link (String rel)
 Retrieves a single link with a specific relation type. More...
 
UriTemplate linkTemplate (String rel)
 Retrieves a link template with a specific relation type. More...
 
default URI linkTemplate (String rel, String variableName, Object value)
 Retrieves a link template with a specific relation type and resolves it. More...
 

Detailed Description

REST endpoint, i.e.

a remote HTTP resource.

Member Function Documentation

◆ getExecutor()

Executor net.typedrest.Endpoint.getExecutor ( )

The REST executor used to communicate with the remote resource.

Returns
The REST executor used to communicate with the remote resource.

◆ getLinks()

Set<URI> net.typedrest.Endpoint.getLinks ( String  rel)

Retrieves all links with a specific relation type cached from the last request.

Parameters
relThe relation type of the links to look for.
Returns
The hrefs of the links resolved relative to this endpoint's URI.

Implemented in net.typedrest.AbstractEndpoint.

◆ getLinksWithTitles()

Map<URI, String> net.typedrest.Endpoint.getLinksWithTitles ( String  rel)

Retrieves all links (with titles) with a specific relation type cached from the last request.

Parameters
relThe relation type of the links to look for.
Returns
A map of hrefs (resolved relative to this endpoint's URI) to titles (may be null).

Implemented in net.typedrest.AbstractEndpoint.

◆ getSerializer()

ObjectMapper net.typedrest.Endpoint.getSerializer ( )

Controls the serialization of entities sent to and received from the server.

Returns
Controls the serialization of entities sent to and received from the server.

◆ getUri()

URI net.typedrest.Endpoint.getUri ( )

The HTTP URI of the remote resource.

Returns
The HTTP URI of the remote resource.

◆ link()

URI net.typedrest.Endpoint.link ( String  rel)

Retrieves a single link with a specific relation type.

Uses cached data from last response if possible. Tries lazy lookup with HTTP HEAD on cache miss.

Parameters
relThe relation type of the link to look for.
Returns
The href of the link resolved relative to this endpoint's URI.
Exceptions
RuntimeExceptionNo link with the specified relation type could be found.

Implemented in net.typedrest.AbstractEndpoint.

◆ linkTemplate() [1/2]

UriTemplate net.typedrest.Endpoint.linkTemplate ( String  rel)

Retrieves a link template with a specific relation type.

Uses cached data from last response if possible. Tries lazy lookup with HTTP HEAD on cache miss.

Parameters
relThe relation type of the template to look for.
Returns
The unresolved link template.
Exceptions
RuntimeExceptionNo link template with the specified relation type could be found.

Implemented in net.typedrest.AbstractEndpoint.

◆ linkTemplate() [2/2]

default URI net.typedrest.Endpoint.linkTemplate ( String  rel,
String  variableName,
Object  value 
)

Retrieves a link template with a specific relation type and resolves it.

Parameters
relThe relation type of the template to look for.
variableNameThe name of the variable to insert.
valueThe value to insert for the variable.
Returns
The href of the link resolved relative to this endpoint's URI.
Exceptions
RuntimeExceptionNo link template with the specified relation type could be found.

The documentation for this interface was generated from the following file: