public class DirectionalRecordAndGeoGroupToXML implements MapBinder {
@SuppressWarnings("unchecked")
@Override
public <R extends HttpRequest> R bindToRequest(R request, Map<String, Object> postParams) {
DirectionalPoolRecord record = DirectionalPoolRecord.class.cast(postParams.get("record"));
DirectionalGroup group = DirectionalGroup.class.cast(postParams.get("group"));
String xml = toXML(postParams.get("poolId"), record, group, postParams.get("dirPoolRecordId"),
postParams.get("groupId"));
return (R) request.toBuilder().payload(xml).build();
}