From 00b5d77fa6299907223912bffe265f1740933094 Mon Sep 17 00:00:00 2001 From: Inderjeet Singh Date: Tue, 20 Apr 2010 22:45:48 +0000 Subject: [PATCH] Revised methods using TypedKey to use the class contained in the TypedKey instead of explicitly asking for it as a method parameter. --- .../definition/WebServiceCallSpec.java | 16 ++++++++-------- .../webservice/definition/rest/RestCallSpec.java | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/wsdef/src/main/java/com/google/gson/webservice/definition/WebServiceCallSpec.java b/wsdef/src/main/java/com/google/gson/webservice/definition/WebServiceCallSpec.java index 2e886c21..1756fe53 100644 --- a/wsdef/src/main/java/com/google/gson/webservice/definition/WebServiceCallSpec.java +++ b/wsdef/src/main/java/com/google/gson/webservice/definition/WebServiceCallSpec.java @@ -55,8 +55,8 @@ public final class WebServiceCallSpec { return this; } - public Builder addRequestParam(TypedKey paramKey, Class typeOfParam) { - return addRequestParam(paramKey.getName(), typeOfParam); + public Builder addRequestParam(TypedKey param) { + return addRequestParam(param.getName(), param.getClassOfT()); } public Builder addRequestParam(String paramName, Type type) { @@ -64,8 +64,8 @@ public final class WebServiceCallSpec { return this; } - public Builder addRequestBodyParam(TypedKey paramKey, Class typeOfParam) { - return addRequestBodyParam(paramKey.getName(), typeOfParam); + public Builder addRequestBodyParam(TypedKey param) { + return addRequestBodyParam(param.getName(), param.getClassOfT()); } public Builder addRequestBodyParam(String paramName, Type type) { @@ -73,8 +73,8 @@ public final class WebServiceCallSpec { return this; } - public Builder addResponseParam(TypedKey paramKey, Class typeOfParam) { - return addResponseParam(paramKey.getName(), typeOfParam); + public Builder addResponseParam(TypedKey param) { + return addResponseParam(param.getName(), param.getClassOfT()); } public Builder addResponseParam(String paramName, Type type) { @@ -82,8 +82,8 @@ public final class WebServiceCallSpec { return this; } - public Builder addResponseBodyParam(TypedKey paramKey, Class typeOfParam) { - return addResponseBodyParam(paramKey.getName(), typeOfParam); + public Builder addResponseBodyParam(TypedKey param) { + return addResponseBodyParam(param.getName(), param.getClassOfT()); } public Builder addResponseBodyParam(String paramName, Type type) { diff --git a/wsdef/src/main/java/com/google/gson/webservice/definition/rest/RestCallSpec.java b/wsdef/src/main/java/com/google/gson/webservice/definition/rest/RestCallSpec.java index 01369ca0..1d567ada 100644 --- a/wsdef/src/main/java/com/google/gson/webservice/definition/rest/RestCallSpec.java +++ b/wsdef/src/main/java/com/google/gson/webservice/definition/rest/RestCallSpec.java @@ -48,13 +48,13 @@ public final class RestCallSpec { return this; } - public Builder addRequestParam(TypedKey paramKey, Class typeOfParam) { - reqParamsSpecBuilder.put(paramKey.getName(), typeOfParam); + public Builder addRequestParam(TypedKey param) { + reqParamsSpecBuilder.put(param.getName(), param.getClassOfT()); return this; } - public Builder addResponseParam(TypedKey paramKey, Class typeOfParam) { - resParamsSpecBuilder.put(paramKey.getName(), typeOfParam); + public Builder addResponseParam(TypedKey param) { + resParamsSpecBuilder.put(param.getName(), param.getClassOfT()); return this; }