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 io.swagger.v3.oas.annotations.media.Schema;
22  import javax.ws.rs.PathParam;
23  import org.apache.commons.lang3.builder.EqualsBuilder;
24  import org.apache.commons.lang3.builder.HashCodeBuilder;
25  
26  public class FIQLQueryTO implements NamedEntityTO {
27  
28      private static final long serialVersionUID = -4467481248062334069L;
29  
30      private String key;
31  
32      private String name;
33  
34      private String target;
35  
36      private String fiql;
37  
38      @Schema(accessMode = Schema.AccessMode.READ_ONLY)
39      @Override
40      public String getKey() {
41          return key;
42      }
43  
44      @PathParam("key")
45      @Override
46      public void setKey(final String key) {
47          this.key = key;
48      }
49  
50      @Override
51      public String getName() {
52          return name;
53      }
54  
55      @Override
56      public void setName(final String name) {
57          this.name = name;
58      }
59  
60      public String getTarget() {
61          return target;
62      }
63  
64      public void setTarget(final String target) {
65          this.target = target;
66      }
67  
68      public String getFiql() {
69          return fiql;
70      }
71  
72      public void setFiql(final String fiql) {
73          this.fiql = fiql;
74      }
75  
76      @Override
77      public int hashCode() {
78          return new HashCodeBuilder().
79                  appendSuper(super.hashCode()).
80                  append(key).
81                  append(name).
82                  append(target).
83                  append(fiql).
84                  build();
85      }
86  
87      @Override
88      public boolean equals(final Object obj) {
89          if (this == obj) {
90              return true;
91          }
92          if (obj == null) {
93              return false;
94          }
95          if (getClass() != obj.getClass()) {
96              return false;
97          }
98          final FIQLQueryTO other = (FIQLQueryTO) obj;
99          return new EqualsBuilder().
100                 appendSuper(super.equals(obj)).
101                 append(key, other.key).
102                 append(name, other.name).
103                 append(target, other.target).
104                 append(fiql, other.fiql).
105                 build();
106     }
107 }