Class VoidBodyReader
java.lang.Object
ru.vyarus.dropwizard.guice.test.client.builder.util.VoidBodyReader
- All Implemented Interfaces:
jakarta.ws.rs.ext.MessageBodyReader<Void>
@Provider
@Consumes
public class VoidBodyReader
extends Object
implements jakarta.ws.rs.ext.MessageBodyReader<Void>
In theory,
response.readEntity(Void.class) should completely ignore response content (if present), but,
actually jersey throws no mapper found error. This mapper should be used as a workaround: to completely ignore
the response body.- Since:
- 17.09.2025
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanisReadable(Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType) readFrom(Class<Void> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType, jakarta.ws.rs.core.MultivaluedMap<String, String> httpHeaders, InputStream entityStream)
-
Constructor Details
-
VoidBodyReader
public VoidBodyReader()
-
-
Method Details
-
isReadable
public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType) - Specified by:
isReadablein interfacejakarta.ws.rs.ext.MessageBodyReader<Void>
-
readFrom
public Void readFrom(Class<Void> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType, jakarta.ws.rs.core.MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException, jakarta.ws.rs.WebApplicationException- Specified by:
readFromin interfacejakarta.ws.rs.ext.MessageBodyReader<Void>- Throws:
IOExceptionjakarta.ws.rs.WebApplicationException
-