public class APIBase<T> extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
AUTHORIZATION |
static String |
ERROR_MESSAGE_TEMPLATE |
static com.fasterxml.jackson.databind.ObjectMapper |
objectMapper |
static String |
PLUS_REPLACEMENT |
static String |
QUERY_PARAM_PAGE |
static String |
QUERY_PARAM_SIZE |
static String |
QUERY_PARAM_SORT |
| Constructor and Description |
|---|
APIBase() |
| Modifier and Type | Method and Description |
|---|---|
org.springframework.web.util.UriComponents |
composeUriComponents(long page,
long size,
String sort,
StringBuilder url)
compse the components
|
void |
delete(String href)
Deletes a ${entity.name} by href
|
org.springframework.http.RequestEntity<Void> |
getRequest(String URL)
A request
|
String |
getToken()
Returns the token
|
org.springframework.http.RequestEntity<Void> |
postRequest(String URL) |
void |
processAssociations(org.springframework.hateoas.EntityModel<?> sourceObject,
org.springframework.hateoas.EntityModel<?> savedObject) |
org.springframework.web.client.RestTemplate |
restTemplate() |
org.springframework.web.client.RestTemplate |
restTemplate(boolean secured)
A new resttemplate
|
void |
setTokenStore(GenericTokenStore store) |
public static final String ERROR_MESSAGE_TEMPLATE
public static final String AUTHORIZATION
public static final String QUERY_PARAM_PAGE
public static final String QUERY_PARAM_SIZE
public static final String QUERY_PARAM_SORT
public static final String PLUS_REPLACEMENT
public static final com.fasterxml.jackson.databind.ObjectMapper objectMapper
public org.springframework.web.client.RestTemplate restTemplate()
public void setTokenStore(GenericTokenStore store)
public org.springframework.web.client.RestTemplate restTemplate(boolean secured)
secured - indicating a secured templatepublic String getToken()
public org.springframework.http.RequestEntity<Void> getRequest(String URL)
URL - the url for which to compose a requestpublic void processAssociations(org.springframework.hateoas.EntityModel<?> sourceObject,
org.springframework.hateoas.EntityModel<?> savedObject)
public void delete(String href)
href - the href givenpublic org.springframework.web.util.UriComponents composeUriComponents(long page,
long size,
String sort,
StringBuilder url)
page - the pagesize - the sizesort - the sorturl - the urlCopyright © 2019–2020 personify. All rights reserved.