TypedRest for Java
|
REST endpoint that represents a collection of TEntity
s as TElementEndpoint
s.
More...
Public Member Functions | |
Class< TEntity > | getEntityType () |
Returns the type of entity the endpoint represents. More... | |
TElementEndpoint | get (String id) |
Returns a ElementEndpoint for a specific child element of this collection. More... | |
TElementEndpoint | get (TEntity entity) |
Returns a ElementEndpoint for a specific child element of this collection. More... | |
Optional< Boolean > | isReadAllAllowed () |
Shows whether the server has indicated that readAll() is currently allowed. More... | |
List< TEntity > | readAll () throws IOException, IllegalArgumentException, IllegalAccessException, FileNotFoundException, IllegalStateException |
Returns all TEntity s. More... | |
Optional< Boolean > | isReadRangeAllowed () |
Shows whether the server has indicated that readRange(Long,Long) is allowed. More... | |
PartialResponse< TEntity > | readRange (Long from, Long to) throws IOException, IllegalArgumentException, IllegalAccessException, FileNotFoundException, IllegalStateException |
Returns all TElementEndpoint s within a specific range of the set. More... | |
Optional< Boolean > | isCreateAllowed () |
Shows whether the server has indicated that create(java.lang.Object) is currently allowed. More... | |
TElementEndpoint | create (TEntity entity) throws IOException, IllegalArgumentException, IllegalAccessException, FileNotFoundException, IllegalStateException |
Creates a new TEntity . More... | |
Optional< Boolean > | isCreateAllAllowed () |
Shows whether the server has indicated that createAll(java.lang.Iterable) is currently allowed. More... | |
void | createAll (Iterable< TEntity > entities) throws IOException, IllegalArgumentException, IllegalAccessException, FileNotFoundException, IllegalStateException |
Creates multiple new TEntity s. More... | |
Optional< Boolean > | isSetAllAllowed () |
Shows whether the server has indicated that setAll(java.util.Collection) is currently allowed. More... | |
void | setAll (Collection< TEntity > entities) throws IOException, IllegalArgumentException, IllegalAccessException, FileNotFoundException |
Replaces the entire content of the collection with new TEntity s. More... | |
![]() | |
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... | |
REST endpoint that represents a collection of TEntity
s as TElementEndpoint
s.
Use the more constrained CollectionEndpoint when possible.
<TEntity> | The type of entity the endpoint represents. |
<TElementEndpoint> | The specific type of ElementEndpoint to provide for individual TEntity s. |
TElementEndpoint net.typedrest.GenericCollectionEndpoint< TEntity, TElementEndpoint extends Endpoint >.create | ( | TEntity | entity | ) | throws IOException, IllegalArgumentException, IllegalAccessException, FileNotFoundException, IllegalStateException |
Creates a new TEntity
.
entity | The new TEntity . |
TEntity
; may be null
if the server deferred creating the resource.IOException | Network communication failed. |
IllegalArgumentException | HttpStatus#SC_BAD_REQUEST |
IllegalAccessException | HttpStatus#SC_UNAUTHORIZED or HttpStatus#SC_FORBIDDEN |
FileNotFoundException | HttpStatus#SC_NOT_FOUND or HttpStatus#SC_GONE |
IllegalStateException | HttpStatus#SC_CONFLICT |
RuntimeException | Other non-success status code. |
void net.typedrest.GenericCollectionEndpoint< TEntity, TElementEndpoint extends Endpoint >.createAll | ( | Iterable< TEntity > | entities | ) | throws IOException, IllegalArgumentException, IllegalAccessException, FileNotFoundException, IllegalStateException |
Creates multiple new TEntity
s.
entities | The new TEntity s. |
IOException | Network communication failed. |
IllegalArgumentException | HttpStatus#SC_BAD_REQUEST |
IllegalAccessException | HttpStatus#SC_UNAUTHORIZED or HttpStatus#SC_FORBIDDEN |
FileNotFoundException | HttpStatus#SC_NOT_FOUND or HttpStatus#SC_GONE |
IllegalStateException | HttpStatus#SC_CONFLICT |
RuntimeException | Other non-success status code. |
TElementEndpoint net.typedrest.GenericCollectionEndpoint< TEntity, TElementEndpoint extends Endpoint >.get | ( | String | id | ) |
Returns a ElementEndpoint for a specific child element of this collection.
id | The ID identifying the entity in the collection. |
TElementEndpoint net.typedrest.GenericCollectionEndpoint< TEntity, TElementEndpoint extends Endpoint >.get | ( | TEntity | entity | ) |
Returns a ElementEndpoint for a specific child element of this collection.
entity | An existing entity to extract the ID from. |
Class<TEntity> net.typedrest.GenericCollectionEndpoint< TEntity, TElementEndpoint extends Endpoint >.getEntityType | ( | ) |
Returns the type of entity the endpoint represents.
Optional<Boolean> net.typedrest.GenericCollectionEndpoint< TEntity, TElementEndpoint extends Endpoint >.isCreateAllAllowed | ( | ) |
Shows whether the server has indicated that createAll(java.lang.Iterable) is currently allowed.
Uses cached data from last response.
Optional<Boolean> net.typedrest.GenericCollectionEndpoint< TEntity, TElementEndpoint extends Endpoint >.isCreateAllowed | ( | ) |
Shows whether the server has indicated that create(java.lang.Object) is currently allowed.
Uses cached data from last response.
Optional<Boolean> net.typedrest.GenericCollectionEndpoint< TEntity, TElementEndpoint extends Endpoint >.isReadAllAllowed | ( | ) |
Shows whether the server has indicated that readAll() is currently allowed.
Uses cached data from last response.
Optional<Boolean> net.typedrest.GenericCollectionEndpoint< TEntity, TElementEndpoint extends Endpoint >.isReadRangeAllowed | ( | ) |
Shows whether the server has indicated that readRange(Long,Long) is allowed.
Uses cached data from last response.
Optional<Boolean> net.typedrest.GenericCollectionEndpoint< TEntity, TElementEndpoint extends Endpoint >.isSetAllAllowed | ( | ) |
Shows whether the server has indicated that setAll(java.util.Collection) is currently allowed.
Uses cached data from last response.
List<TEntity> net.typedrest.GenericCollectionEndpoint< TEntity, TElementEndpoint extends Endpoint >.readAll | ( | ) | throws IOException, IllegalArgumentException, IllegalAccessException, FileNotFoundException, IllegalStateException |
Returns all TEntity
s.
TEntity
s. IOException | Network communication failed. |
IllegalArgumentException | HttpStatus#SC_BAD_REQUEST |
IllegalAccessException | HttpStatus#SC_UNAUTHORIZED or HttpStatus#SC_FORBIDDEN |
FileNotFoundException | HttpStatus#SC_NOT_FOUND or HttpStatus#SC_GONE |
IllegalStateException | HttpStatus#SC_CONFLICT |
RuntimeException | Other non-success status code. |
PartialResponse<TEntity> net.typedrest.GenericCollectionEndpoint< TEntity, TElementEndpoint extends Endpoint >.readRange | ( | Long | from, |
Long | to | ||
) | throws IOException, IllegalArgumentException, IllegalAccessException, FileNotFoundException, IllegalStateException |
Returns all TElementEndpoint
s within a specific range of the set.
from | The index of the first element to return. null to use to to specify a start point counting from the end of the set. |
to | The index of the last element to return. Alternatively the index of the first element to return counting from the end of the set if from is null . null to read to the end. |
TElementEndpoint
s and the range they come from. May not exactly match the request range. IOException | Network communication failed. |
IllegalArgumentException | HttpStatus#SC_BAD_REQUEST |
IllegalAccessException | HttpStatus#SC_UNAUTHORIZED or HttpStatus#SC_FORBIDDEN |
FileNotFoundException | HttpStatus#SC_NOT_FOUND or HttpStatus#SC_GONE |
IllegalStateException | The requested range is not satisfiable. |
RuntimeException | Other non-success status code. |
void net.typedrest.GenericCollectionEndpoint< TEntity, TElementEndpoint extends Endpoint >.setAll | ( | Collection< TEntity > | entities | ) | throws IOException, IllegalArgumentException, IllegalAccessException, FileNotFoundException |
Replaces the entire content of the collection with new TEntity
s.
entities | The new set of TEntity s the collection shall contain. |
IOException | Network communication failed. |
IllegalArgumentException | HttpStatus#SC_BAD_REQUEST |
IllegalAccessException | HttpStatus#SC_UNAUTHORIZED or HttpStatus#SC_FORBIDDEN |
FileNotFoundException | HttpStatus#SC_NOT_FOUND or HttpStatus#SC_GONE |
IllegalStateException | The entities have changed since they were last retrieved with readAll(). Your changes were rejected to prevent a lost update. |
RuntimeException | Other non-success status code. |