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.to;
20  
21  import javax.ws.rs.PathParam;
22  import org.apache.commons.lang3.builder.EqualsBuilder;
23  import org.apache.commons.lang3.builder.HashCodeBuilder;
24  import org.apache.syncope.common.lib.types.ImplementationEngine;
25  
26  public class ImplementationTO implements EntityTO {
27  
28      private static final long serialVersionUID = 2703397698393060586L;
29  
30      private String key;
31  
32      private ImplementationEngine engine;
33  
34      private String type;
35  
36      private String body;
37  
38      @Override
39      public String getKey() {
40          return key;
41      }
42  
43      @PathParam("key")
44      @Override
45      public void setKey(final String key) {
46          this.key = key;
47      }
48  
49      public ImplementationEngine getEngine() {
50          return engine;
51      }
52  
53      public void setEngine(final ImplementationEngine engine) {
54          this.engine = engine;
55      }
56  
57      public String getType() {
58          return type;
59      }
60  
61      @PathParam("type")
62      public void setType(final String type) {
63          this.type = type;
64      }
65  
66      public String getBody() {
67          return body;
68      }
69  
70      public void setBody(final String body) {
71          this.body = body;
72      }
73  
74      @Override
75      public int hashCode() {
76          return new HashCodeBuilder().
77                  append(key).
78                  append(engine).
79                  append(type).
80                  append(body).
81                  build();
82      }
83  
84      @Override
85      public boolean equals(final Object obj) {
86          if (this == obj) {
87              return true;
88          }
89          if (obj == null) {
90              return false;
91          }
92          if (getClass() != obj.getClass()) {
93              return false;
94          }
95          final ImplementationTO other = (ImplementationTO) obj;
96          return new EqualsBuilder().
97                  append(key, other.key).
98                  append(engine, other.engine).
99                  append(type, other.type).
100                 append(body, other.body).
101                 build();
102     }
103 }