From 08d3827daee728f6082785d3177bdf868ca9cf1c Mon Sep 17 00:00:00 2001 From: Inderjeet Singh Date: Tue, 20 Jul 2010 00:36:40 +0000 Subject: [PATCH] Added methods with TypedKeys --- .../google/gson/webservice/definition/ResponseBody.java | 7 ++++++- .../gson/webservice/definition/WebServiceRequest.java | 5 ++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/wsdef/src/main/java/com/google/gson/webservice/definition/ResponseBody.java b/wsdef/src/main/java/com/google/gson/webservice/definition/ResponseBody.java index 13b6e17c..3a664ff7 100644 --- a/wsdef/src/main/java/com/google/gson/webservice/definition/ResponseBody.java +++ b/wsdef/src/main/java/com/google/gson/webservice/definition/ResponseBody.java @@ -42,7 +42,12 @@ public final class ResponseBody extends ContentBody { public Builder put(String paramName, Object content, Type typeOfContent) { return (Builder) super.put(paramName, content, typeOfContent); } - + + @Override + public Builder put(TypedKey paramKey, T param) { + return (Builder) super.put(paramKey, param); + } + public ResponseBody build() { return new ResponseBody(spec, contents); } diff --git a/wsdef/src/main/java/com/google/gson/webservice/definition/WebServiceRequest.java b/wsdef/src/main/java/com/google/gson/webservice/definition/WebServiceRequest.java index 61be18a4..33946b15 100644 --- a/wsdef/src/main/java/com/google/gson/webservice/definition/WebServiceRequest.java +++ b/wsdef/src/main/java/com/google/gson/webservice/definition/WebServiceRequest.java @@ -58,9 +58,8 @@ public final class WebServiceRequest { return ContentBodySpec.JSON_CONTENT_TYPE; } - @SuppressWarnings("unchecked") - public T getHeader(String headerName) { - return (T) headers.get(headerName); + public T getHeader(TypedKey headerKey) { + return headers.get(headerKey); } @Override