Class RestResponseEntity<T>

  • Type Parameters:
    T - the response's body type

    public class RestResponseEntity<T>
    extends org.springframework.http.ResponseEntity<T>
    A ResponseEntity that offers an ErrorModel, which contains details about potential errors on the server side.
    Author:
    Matthias Müller
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.springframework.http.ResponseEntity

        org.springframework.http.ResponseEntity.BodyBuilder, org.springframework.http.ResponseEntity.HeadersBuilder<B extends org.springframework.http.ResponseEntity.HeadersBuilder<B>>
    • Field Summary

      • Fields inherited from class org.springframework.http.HttpEntity

        EMPTY
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      ErrorModel getError()
      The error, if any
      static <T> RestResponseEntity<T> of​(org.springframework.http.ResponseEntity<T> exchange)  
      • Methods inherited from class org.springframework.http.ResponseEntity

        accepted, badRequest, created, equals, getStatusCode, getStatusCodeValue, hashCode, internalServerError, noContent, notFound, of, ok, ok, status, status, toString, unprocessableEntity
      • Methods inherited from class org.springframework.http.HttpEntity

        getBody, getHeaders, hasBody
    • Constructor Detail

      • RestResponseEntity

        public RestResponseEntity​(org.springframework.http.HttpStatus status)
      • RestResponseEntity

        public RestResponseEntity​(org.springframework.util.MultiValueMap<String,​String> headers,
                                  org.springframework.http.HttpStatus status)
      • RestResponseEntity

        public RestResponseEntity​(T body,
                                  org.springframework.http.HttpStatus status)
      • RestResponseEntity

        public RestResponseEntity​(T body,
                                  org.springframework.util.MultiValueMap<String,​String> headers,
                                  org.springframework.http.HttpStatus status)
      • RestResponseEntity

        public RestResponseEntity​(ErrorModel error,
                                  org.springframework.http.HttpStatus status)
      • RestResponseEntity

        public RestResponseEntity​(ErrorModel error,
                                  org.springframework.util.MultiValueMap<String,​String> headers,
                                  org.springframework.http.HttpStatus status)
    • Method Detail

      • getError

        public ErrorModel getError()
        The error, if any
        Returns:
        the error
      • of

        public static <T> RestResponseEntity<T> of​(org.springframework.http.ResponseEntity<T> exchange)