@Singleton
public class BindNextRecord implements Binder {
@SuppressWarnings("unchecked")
@Override
public <R extends HttpRequest> R bindToRequest(R request, Object payload) {
NextRecord from = NextRecord.class.cast(payload);
Builder<?> builder = request.toBuilder();
builder.addQueryParam("name", from.getName());
if (from.getType().isPresent())
builder.addQueryParam("type", from.getType().get());
if (from.getIdentifier().isPresent())
builder.addQueryParam("identifier", from.getIdentifier().get());
return (R) builder.build();
}