View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.syncope.common.lib.command;
20  
21  import javax.ws.rs.PathParam;
22  import org.apache.syncope.common.lib.BaseBean;
23  
24  public class CommandTO implements BaseBean {
25  
26      private static final long serialVersionUID = 7711356516501958110L;
27  
28      public static class Builder {
29  
30          protected CommandTO instance;
31  
32          public Builder(final String key) {
33              getInstance().setKey(key);
34          }
35  
36          protected CommandTO newInstance() {
37              return new CommandTO();
38          }
39  
40          protected final CommandTO getInstance() {
41              if (instance == null) {
42                  instance = newInstance();
43              }
44              return instance;
45          }
46  
47          public Builder args(final CommandArgs args) {
48              getInstance().setArgs(args);
49              return this;
50          }
51  
52          public CommandTO build() {
53              return getInstance();
54          }
55      }
56  
57      private String key;
58  
59      private CommandArgs args;
60  
61      public String getKey() {
62          return key;
63      }
64  
65      @PathParam("key")
66      public void setKey(final String key) {
67          this.key = key;
68      }
69  
70      public CommandArgs getArgs() {
71          return args;
72      }
73  
74      public void setArgs(final CommandArgs args) {
75          this.args = args;
76      }
77  }