@Override public Response<IdEntityResponse<K, V>> decodeResponse(RestResponse restResponse) throws RestLiDecodingException { final Response<IdEntityResponse<K, V>> rawResponse = super.decodeResponse(restResponse); final Map<String, String> modifiableHeaders = new TreeMap<String, String>(String.CASE_INSENSITIVE_ORDER); modifiableHeaders.putAll(rawResponse.getHeaders()); modifiableHeaders.remove(RestConstants.HEADER_ID); modifiableHeaders.remove(RestConstants.HEADER_RESTLI_ID); return new ResponseImpl<IdEntityResponse<K, V>>(rawResponse.getStatus(), modifiableHeaders, rawResponse.getCookies(), rawResponse.getEntity(), rawResponse.getError()); }
@Override public Response<EmptyRecord> decodeResponse(RestResponse restResponse) throws RestLiDecodingException { final Response<EmptyRecord> rawResponse = super.decodeResponse(restResponse); // ResponseImpl will make the headers unmodifiable final Map<String, String> modifiableHeaders = new TreeMap<String, String>(String.CASE_INSENSITIVE_ORDER); modifiableHeaders.putAll(rawResponse.getHeaders()); // remove ID header to prevent user to access the weakly typed ID modifiableHeaders.remove(RestConstants.HEADER_ID); modifiableHeaders.remove(RestConstants.HEADER_RESTLI_ID); return new ResponseImpl<EmptyRecord>(rawResponse.getStatus(), modifiableHeaders, rawResponse.getCookies(), rawResponse.getEntity(), rawResponse.getError()); }
@Override public Response<IdResponse<K>> decodeResponse(RestResponse restResponse) throws RestLiDecodingException { final Response<IdResponse<K>> rawResponse = super.decodeResponse(restResponse); // ResponseImpl will make the headers unmodifiable final Map<String, String> modifiableHeaders = new TreeMap<String, String>(String.CASE_INSENSITIVE_ORDER); modifiableHeaders.putAll(rawResponse.getHeaders()); // remove ID header to prevent user to access the weakly typed ID modifiableHeaders.remove(RestConstants.HEADER_ID); modifiableHeaders.remove(RestConstants.HEADER_RESTLI_ID); return new ResponseImpl<IdResponse<K>>(rawResponse.getStatus(), modifiableHeaders, rawResponse.getCookies(), rawResponse.getEntity(), rawResponse.getError()); }