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

REST endpoint that represents a collection of TEntitys as ElementEndpoints. More...

Inheritance diagram for net.typedrest.CollectionEndpoint< TEntity >:
net.typedrest.GenericCollectionEndpoint< TEntity, ElementEndpoint< TEntity > > net.typedrest.BulkCollectionEndpoint< TEntity > net.typedrest.CollectionEndpointImpl< TEntity > net.typedrest.PagedCollectionEndpoint< TEntity > net.typedrest.StreamEndpoint< TEntity > net.typedrest.BulkCollectionEndpointImpl< TEntity > net.typedrest.PagedCollectionEndpointImpl< TEntity > net.typedrest.StreamEndpointImpl< TEntity >

Public Member Functions

default boolean contains (String id) throws IOException, IllegalAccessException
 Determines whether the collection contains a specific entity. More...
 
default boolean contains (TEntity element) throws IOException, IllegalAccessException
 Determines whether the collection contains a specific entity. More...
 
default TEntity set (TEntity element) throws IOException, IllegalArgumentException, IllegalAccessException, FileNotFoundException, IllegalStateException
 Sets/replaces an existing element in the collection. More...
 
default TEntity merge (TEntity element) throws IOException, IllegalArgumentException, IllegalAccessException, FileNotFoundException, IllegalStateException
 Modifies an existing element in the collection by merging changes. More...
 
default void delete (String id) throws IOException, IllegalArgumentException, IllegalAccessException, FileNotFoundException, IllegalStateException
 Deletes an existing element from the collection. More...
 
default void delete (TEntity element) throws IOException, IllegalArgumentException, IllegalAccessException, FileNotFoundException, IllegalStateException
 Deletes an existing element from the collection. More...
 
- Public Member Functions inherited from net.typedrest.GenericCollectionEndpoint< TEntity, ElementEndpoint< TEntity > >
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 TEntitys. 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 TElementEndpoints 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 TEntitys. 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 TEntitys. More...
 

Detailed Description

REST endpoint that represents a collection of TEntitys as ElementEndpoints.

Parameters
<TEntity>The type of entity the endpoint represents.

Member Function Documentation

◆ contains() [1/2]

default boolean net.typedrest.CollectionEndpoint< TEntity >.contains ( String  id) throws IOException, IllegalAccessException

Determines whether the collection contains a specific entity.

Parameters
idThe ID identifying the entity in the collection.
Returns
true if the entity currently exists, false if it does not.
Exceptions
IOExceptionNetwork communication failed.
IllegalAccessExceptionHttpStatus#SC_UNAUTHORIZED or HttpStatus#SC_FORBIDDEN
RuntimeExceptionOther non-success status code.

◆ contains() [2/2]

default boolean net.typedrest.CollectionEndpoint< TEntity >.contains ( TEntity  element) throws IOException, IllegalAccessException

Determines whether the collection contains a specific entity.

Parameters
elementThe element to be checked.
Returns
true if the entity currently exists, false if it does not.
Exceptions
IOExceptionNetwork communication failed.
IllegalAccessExceptionHttpStatus#SC_UNAUTHORIZED or HttpStatus#SC_FORBIDDEN
RuntimeExceptionOther non-success status code.

◆ delete() [1/2]

default void net.typedrest.CollectionEndpoint< TEntity >.delete ( String  id) throws IOException, IllegalArgumentException, IllegalAccessException, FileNotFoundException, IllegalStateException

Deletes an existing element from the collection.

Parameters
idThe ID identifying the entity in the collection.
Exceptions
IOExceptionNetwork communication failed.
IllegalArgumentExceptionHttpStatus#SC_BAD_REQUEST
IllegalAccessExceptionHttpStatus#SC_UNAUTHORIZED or HttpStatus#SC_FORBIDDEN
FileNotFoundExceptionHttpStatus#SC_NOT_FOUND or HttpStatus#SC_GONE
IllegalStateExceptionThe entity has changed since it was last retrieved. Your delete call was rejected to prevent a lost update.
RuntimeExceptionOther non-success status code.

◆ delete() [2/2]

default void net.typedrest.CollectionEndpoint< TEntity >.delete ( TEntity  element) throws IOException, IllegalArgumentException, IllegalAccessException, FileNotFoundException, IllegalStateException

Deletes an existing element from the collection.

Parameters
elementThe element to be deleted.
Exceptions
IOExceptionNetwork communication failed.
IllegalArgumentExceptionHttpStatus#SC_BAD_REQUEST
IllegalAccessExceptionHttpStatus#SC_UNAUTHORIZED or HttpStatus#SC_FORBIDDEN
FileNotFoundExceptionHttpStatus#SC_NOT_FOUND or HttpStatus#SC_GONE
IllegalStateExceptionThe entity has changed since it was last retrieved. Your delete call was rejected to prevent a lost update.
RuntimeExceptionOther non-success status code.

◆ merge()

default TEntity net.typedrest.CollectionEndpoint< TEntity >.merge ( TEntity  element) throws IOException, IllegalArgumentException, IllegalAccessException, FileNotFoundException, IllegalStateException

Modifies an existing element in the collection by merging changes.

Parameters
elementThe TEntity data to merge with the existing element.
Returns
The TEntity as returned by the server, possibly with additional fields set. null if the server does not respond with a result entity.
Exceptions
IOExceptionNetwork communication failed.
IllegalArgumentExceptionHttpStatus#SC_BAD_REQUEST
IllegalAccessExceptionHttpStatus#SC_UNAUTHORIZED or HttpStatus#SC_FORBIDDEN
FileNotFoundExceptionHttpStatus#SC_NOT_FOUND or HttpStatus#SC_GONE
IllegalStateExceptionThe entity has changed since it was last retrieved. Your delete call was rejected to prevent a lost update.
RuntimeExceptionOther non-success status code.

◆ set()

default TEntity net.typedrest.CollectionEndpoint< TEntity >.set ( TEntity  element) throws IOException, IllegalArgumentException, IllegalAccessException, FileNotFoundException, IllegalStateException

Sets/replaces an existing element in the collection.

Parameters
elementThe new state of the element.
Returns
The TEntity as returned by the server, possibly with additional fields set. null if the server does not respond with a result entity.
Exceptions
IOExceptionNetwork communication failed.
IllegalArgumentExceptionHttpStatus#SC_BAD_REQUEST
IllegalAccessExceptionHttpStatus#SC_UNAUTHORIZED or HttpStatus#SC_FORBIDDEN
FileNotFoundExceptionHttpStatus#SC_NOT_FOUND or HttpStatus#SC_GONE
IllegalStateExceptionThe entity has changed since it was last retrieved. Your delete call was rejected to prevent a lost update.
RuntimeExceptionOther non-success status code.

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