TypedRest for Java
Public Member Functions | List of all members
net.typedrest.FunctionEndpoint< TEntity, TResult > Interface Template Reference

REST endpoint that represents an RPC-like function which takes TEntity as input and returns TResult as output. More...

Inheritance diagram for net.typedrest.FunctionEndpoint< TEntity, TResult >:
net.typedrest.TriggerEndpoint net.typedrest.Endpoint net.typedrest.FunctionEndpointImpl< TEntity, TResult >

Public Member Functions

Class< TEntity > getEntityType ()
 Returns the type of entity the endpoint takes as input. More...
 
Class< TResult > getResultType ()
 Returns The type of entity the endpoint returns as output. More...
 
TResult trigger (TEntity entity) throws IOException, IllegalArgumentException, IllegalAccessException, FileNotFoundException, IllegalStateException
 Triggers the function. More...
 
- Public Member Functions inherited from net.typedrest.TriggerEndpoint
Optional< Boolean > isTriggerAllowed ()
 Shows whether the server has indicated that the trigger method is currently allowed. More...
 
void probe () throws IOException, IllegalArgumentException, IllegalAccessException, FileNotFoundException, IllegalStateException
 Queries the server about capabilities of the endpoint without performing any action. More...
 
- Public Member Functions inherited from net.typedrest.Endpoint
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 that represents an RPC-like function which takes TEntity as input and returns TResult as output.

Parameters
<TEntity>The type of entity the endpoint takes as input.
<TResult>The type of entity the endpoint returns as output.

Member Function Documentation

◆ getEntityType()

Class<TEntity> net.typedrest.FunctionEndpoint< TEntity, TResult >.getEntityType ( )

Returns the type of entity the endpoint takes as input.

Returns
The class type.

◆ getResultType()

Class<TResult> net.typedrest.FunctionEndpoint< TEntity, TResult >.getResultType ( )

Returns The type of entity the endpoint returns as output.

Returns
The class type.

◆ trigger()

TResult net.typedrest.FunctionEndpoint< TEntity, TResult >.trigger ( TEntity  entity) throws IOException, IllegalArgumentException, IllegalAccessException, FileNotFoundException, IllegalStateException

Triggers the function.

Parameters
entityThe TEntity to post as input.
Returns
The result returned by the server.
Exceptions
IOExceptionNetwork communication failed.
IllegalArgumentExceptionHttpStatus#SC_BAD_REQUEST
IllegalAccessExceptionHttpStatus#SC_UNAUTHORIZED or HttpStatus#SC_FORBIDDEN
FileNotFoundExceptionHttpStatus#SC_NOT_FOUND or HttpStatus#SC_GONE
IllegalStateExceptionHttpStatus#SC_CONFLICT
RuntimeExceptionOther non-success status code.

Implemented in net.typedrest.FunctionEndpointImpl< TEntity, TResult >.


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