Package io.rocketbase.commons.resource
Class AbstractBaseCrudRestResource<Read,Write>
- java.lang.Object
-
- io.rocketbase.commons.resource.AbstractBaseCrudRestResource<Read,Write>
-
- All Implemented Interfaces:
BaseRestResource
- Direct Known Subclasses:
AbstractCrudChildRestResource,AbstractCrudRestResource
public abstract class AbstractBaseCrudRestResource<Read,Write> extends Object implements BaseRestResource
-
-
Field Summary
Fields Modifier and Type Field Description protected Class<Read>responseClass
-
Constructor Summary
Constructors Constructor Description AbstractBaseCrudRestResource()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected Readcreate(org.springframework.web.util.UriComponentsBuilder uriBuilder, Write write)protected org.springframework.http.HttpEntity<Write>createHttpEntity(Write write)protected abstract org.springframework.core.ParameterizedTypeReference<PageableResult<Read>>createPagedTypeReference()protected voiddelete(org.springframework.web.util.UriComponentsBuilder uriBuilder)protected PageableResult<Read>find(org.springframework.web.util.UriComponentsBuilder uriBuilder)protected Optional<Read>getById(org.springframework.web.util.UriComponentsBuilder uriBuilder)protected org.springframework.web.client.RestTemplategetRestTemplate()protected Readupdate(org.springframework.web.util.UriComponentsBuilder uriBuilder, Write write)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.rocketbase.commons.resource.BaseRestResource
appendParams, createHeaderWithLanguage, createUriComponentsBuilder, ensureEndsWithSlash, ensureStartsAndEndsWithSlash, ensureStartsWithSlash
-
-
-
-
Method Detail
-
getRestTemplate
protected org.springframework.web.client.RestTemplate getRestTemplate()
-
find
protected PageableResult<Read> find(org.springframework.web.util.UriComponentsBuilder uriBuilder)
-
getById
protected Optional<Read> getById(org.springframework.web.util.UriComponentsBuilder uriBuilder)
- Parameters:
uriBuilder- complete uri- Returns:
- optional in case of
NotFoundException) empty
-
create
protected Read create(org.springframework.web.util.UriComponentsBuilder uriBuilder, Write write)
-
update
protected Read update(org.springframework.web.util.UriComponentsBuilder uriBuilder, Write write)
-
delete
protected void delete(org.springframework.web.util.UriComponentsBuilder uriBuilder)
-
createHttpEntity
protected org.springframework.http.HttpEntity<Write> createHttpEntity(Write write)
-
createPagedTypeReference
protected abstract org.springframework.core.ParameterizedTypeReference<PageableResult<Read>> createPagedTypeReference()
-
-