Class APIBase<T>


  • public class APIBase<T>
    extends Object
    • Constructor Detail

      • APIBase

        public APIBase()
    • Method Detail

      • restTemplate

        public org.springframework.web.client.RestTemplate restTemplate()
      • restTemplate

        public org.springframework.web.client.RestTemplate restTemplate​(boolean secured)
        A new resttemplate
        Parameters:
        secured - indicating a secured template
        Returns:
        the resttemplate composed
      • getToken

        public String getToken()
        Returns the token
        Returns:
        a string containing the token
      • getRequest

        public org.springframework.http.RequestEntity<Void> getRequest​(String URL)
        A request
        Parameters:
        URL - the url for which to compose a request
        Returns:
        the requestentity to be returned
      • postRequest

        public org.springframework.http.RequestEntity<Void> postRequest​(String URL)
      • processAssociations

        public void processAssociations​(org.springframework.hateoas.EntityModel<?> sourceObject,
                                        org.springframework.hateoas.EntityModel<?> savedObject)
      • delete

        public void delete​(String href)
        Deletes a ${entity.name} by href
        Parameters:
        href - the href given
      • composeUriComponents

        public org.springframework.web.util.UriComponents composeUriComponents​(long page,
                                                                               long size,
                                                                               String sort,
                                                                               StringBuilder url)
        compse the components
        Parameters:
        page - the page
        size - the size
        sort - the sort
        url - the url
        Returns:
        the uricomponents