camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject camel git commit: overload param and msg
Date Mon, 10 Aug 2015 08:06:54 GMT
Repository: camel
Updated Branches:
  refs/heads/master 46a9a5b49 -> 6520dfa44


overload param and msg


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/6520dfa4
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/6520dfa4
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/6520dfa4

Branch: refs/heads/master
Commit: 6520dfa44d24ff1f0281df59ff5a5dbd694d1ad9
Parents: 46a9a5b
Author: Sebi Calbaza <sebastian.calbaza@softvision.ro>
Authored: Sat Jun 13 09:21:02 2015 +0300
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Mon Aug 10 10:14:10 2015 +0200

----------------------------------------------------------------------
 .../apache/camel/model/rest/RestDefinition.java   | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/6520dfa4/camel-core/src/main/java/org/apache/camel/model/rest/RestDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/rest/RestDefinition.java b/camel-core/src/main/java/org/apache/camel/model/rest/RestDefinition.java
index ab244cb..1af77fc 100644
--- a/camel-core/src/main/java/org/apache/camel/model/rest/RestDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/rest/RestDefinition.java
@@ -280,10 +280,28 @@ public class RestDefinition extends OptionalIdentifiedDefinition<RestDefinition>
         return param(verb);
     }
 
+    public RestDefinition param(RestOperationParamDefinition param) {
+        if (getVerbs().isEmpty()) {
+            throw new IllegalArgumentException("Must add verb first, such as get/post/delete");
+        }
+        VerbDefinition verb = getVerbs().get(getVerbs().size() - 1);
+        verb.getParams().add(param);
+        return this;
+    }
+
     public RestOperationParamDefinition param(VerbDefinition verb) {
         return new RestOperationParamDefinition(verb);
     }
 
+    public RestDefinition responseMessage(RestOperationResponseMsgDefinition msg) {
+        if (getVerbs().isEmpty()) {
+            throw new IllegalArgumentException("Must add verb first, such as get/post/delete");
+        }
+        VerbDefinition verb = getVerbs().get(getVerbs().size() - 1);
+        verb.getResponseMsgs().add(msg);
+        return this;
+    }
+
     public RestOperationResponseMsgDefinition responseMessage() {
         if (getVerbs().isEmpty()) {
             throw new IllegalArgumentException("Must add verb first, such as get/post/delete");


Mime
View raw message