Class VoidResponseHttpMessageConverter

  • All Implemented Interfaces:
    org.springframework.http.converter.HttpMessageConverter<Void>

    public class VoidResponseHttpMessageConverter
    extends Object
    implements org.springframework.http.converter.HttpMessageConverter<Void>
    A HttpMessageConverter that gracefully handles ResponseEntity<Void> responses
    Author:
    Matthias Müller
    • Constructor Detail

      • VoidResponseHttpMessageConverter

        public VoidResponseHttpMessageConverter()
    • Method Detail

      • canRead

        public boolean canRead​(Class<?> clazz,
                               org.springframework.http.MediaType mediaType)
        Specified by:
        canRead in interface org.springframework.http.converter.HttpMessageConverter<Void>
      • canWrite

        public boolean canWrite​(Class<?> clazz,
                                org.springframework.http.MediaType mediaType)
        Specified by:
        canWrite in interface org.springframework.http.converter.HttpMessageConverter<Void>
      • getSupportedMediaTypes

        public List<org.springframework.http.MediaType> getSupportedMediaTypes()
        Specified by:
        getSupportedMediaTypes in interface org.springframework.http.converter.HttpMessageConverter<Void>
      • read

        public Void read​(Class<? extends Void> clazz,
                         org.springframework.http.HttpInputMessage inputMessage)
                  throws IOException,
                         org.springframework.http.converter.HttpMessageNotReadableException
        Specified by:
        read in interface org.springframework.http.converter.HttpMessageConverter<Void>
        Throws:
        IOException
        org.springframework.http.converter.HttpMessageNotReadableException
      • write

        public void write​(Void t,
                          org.springframework.http.MediaType contentType,
                          org.springframework.http.HttpOutputMessage outputMessage)
                   throws IOException,
                          org.springframework.http.converter.HttpMessageNotWritableException
        Specified by:
        write in interface org.springframework.http.converter.HttpMessageConverter<Void>
        Throws:
        IOException
        org.springframework.http.converter.HttpMessageNotWritableException