org.jboss.resteasy.reactive.server.providers.serialisers.ServerBooleanMessageBodyHandler Maven / Gradle / Ivy
package org.jboss.resteasy.reactive.server.providers.serialisers;
import java.io.IOException;
import java.lang.reflect.Type;
import jakarta.ws.rs.WebApplicationException;
import jakarta.ws.rs.core.MediaType;
import org.jboss.resteasy.reactive.common.providers.serialisers.BooleanMessageBodyHandler;
import org.jboss.resteasy.reactive.server.spi.ResteasyReactiveResourceInfo;
import org.jboss.resteasy.reactive.server.spi.ServerMessageBodyReader;
import org.jboss.resteasy.reactive.server.spi.ServerRequestContext;
public class ServerBooleanMessageBodyHandler extends BooleanMessageBodyHandler
implements ServerMessageBodyReader {
public boolean isReadable(Class> type, Type genericType, ResteasyReactiveResourceInfo lazyMethod, MediaType mediaType) {
return type == Boolean.class;
}
@Override
public Boolean readFrom(Class type, Type genericType, MediaType mediaType, ServerRequestContext context)
throws WebApplicationException, IOException {
return Boolean.valueOf(super.readFrom(context.getInputStream(), false));
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy