Added methods with TypedKeys

This commit is contained in:
Inderjeet Singh 2010-07-20 00:36:40 +00:00
parent 8122deb364
commit 08d3827dae
2 changed files with 8 additions and 4 deletions

View File

@ -42,7 +42,12 @@ public final class ResponseBody extends ContentBody {
public Builder put(String paramName, Object content, Type typeOfContent) { public Builder put(String paramName, Object content, Type typeOfContent) {
return (Builder) super.put(paramName, content, typeOfContent); return (Builder) super.put(paramName, content, typeOfContent);
} }
@Override
public <T> Builder put(TypedKey<T> paramKey, T param) {
return (Builder) super.put(paramKey, param);
}
public ResponseBody build() { public ResponseBody build() {
return new ResponseBody(spec, contents); return new ResponseBody(spec, contents);
} }

View File

@ -58,9 +58,8 @@ public final class WebServiceRequest {
return ContentBodySpec.JSON_CONTENT_TYPE; return ContentBodySpec.JSON_CONTENT_TYPE;
} }
@SuppressWarnings("unchecked") public <T> T getHeader(TypedKey<T> headerKey) {
public <T> T getHeader(String headerName) { return headers.get(headerKey);
return (T) headers.get(headerName);
} }
@Override @Override