restx.jackson.JsonEntityRouteBuilder Maven / Gradle / Ivy
package restx.jackson;
import com.fasterxml.jackson.databind.ObjectReader;
import com.fasterxml.jackson.databind.ObjectWriter;
import restx.entity.StdEntityRoute;
import java.lang.reflect.Type;
public class JsonEntityRouteBuilder extends StdEntityRoute.Builder {
public JsonEntityRouteBuilder withObjectWriter(Type type, ObjectWriter writer) {
entityResponseWriter(JsonEntityResponseWriter.using(type, writer));
return this;
}
public JsonEntityRouteBuilder withObjectReader(Type type, ObjectReader reader) {
entityRequestBodyReader(JsonEntityRequestBodyReader.using(type, reader));
return this;
}
}