public class RecordIdBinder implements Binder {
@SuppressWarnings("unchecked")
@Override
public <R extends HttpRequest> R bindToRequest(R request, Object recordId) {
RecordId valueToAppend = RecordId.class.cast(checkNotNull(recordId, "recordId"));
URI path = uriBuilder(request.getEndpoint()).appendPath("/{type}Record/{zone}/{fqdn}/{id}").build(
ImmutableMap.<String, Object> builder()
.put("type", valueToAppend.getType())
.put("zone", valueToAppend.getZone())
.put("fqdn", valueToAppend.getFQDN())
.put("id", valueToAppend.getId()).build());
return (R) request.toBuilder().endpoint(path).build();
}