net.dongliu.commons.request.code.ResponseConverter Maven / Gradle / Ivy
package net.dongliu.commons.request.code;
import net.dongliu.commons.lang.Charsets;
import org.apache.http.HttpEntity;
import java.io.IOException;
/**
* interface to trans body to result
*
* @author Dong Liu
*/
public interface ResponseConverter {
static ResponseConverter string = new StringResponseConverter(Charsets.UTF_8);
static ResponseConverter bytes = new BytesResponseConverter();
/**
* from http Body to result with type T
*/
T convert(HttpEntity httpEntity) throws IOException;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy