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 jakarta.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.password.PasswordManagementConf;
25  
26  public class PasswordManagementTO implements EntityTO {
27  
28      private static final long serialVersionUID = -7203295929825782174L;
29  
30      private String key;
31  
32      private String description;
33  
34      private boolean enabled = false;
35  
36      private PasswordManagementConf conf;
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 String getDescription() {
50          return description;
51      }
52  
53      public void setDescription(final String description) {
54          this.description = description;
55      }
56  
57      public boolean isEnabled() {
58          return enabled;
59      }
60  
61      public void setEnabled(final boolean enabled) {
62          this.enabled = enabled;
63      }
64  
65      public PasswordManagementConf getConf() {
66          return conf;
67      }
68  
69      public void setConf(final PasswordManagementConf conf) {
70          this.conf = conf;
71      }
72  
73      @Override
74      public boolean equals(final Object obj) {
75          if (this == obj) {
76              return true;
77          }
78          if (obj == null) {
79              return false;
80          }
81          if (getClass() != obj.getClass()) {
82              return false;
83          }
84          PasswordManagementTO other = (PasswordManagementTO) obj;
85          return new EqualsBuilder().
86                  append(key, other.key).
87                  append(description, other.description).
88                  append(enabled, other.enabled).
89                  append(conf, other.conf).
90                  build();
91      }
92  
93      @Override
94      public int hashCode() {
95          return new HashCodeBuilder().
96                  append(key).
97                  append(description).
98                  append(conf).
99                  build();
100     }
101 }