1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.syncope.common.lib.clientapps;
20
21 import org.apache.commons.lang3.builder.EqualsBuilder;
22 import org.apache.commons.lang3.builder.HashCodeBuilder;
23
24 public class PrincipalAttributeUsernameAttributeProviderConf extends AbstractAttributeProviderConf {
25
26 private static final long serialVersionUID = -4762223354637243358L;
27
28 private String usernameAttribute;
29
30 public String getUsernameAttribute() {
31 return usernameAttribute;
32 }
33
34 public void setUsernameAttribute(final String usernameAttribute) {
35 this.usernameAttribute = usernameAttribute;
36 }
37
38 @Override
39 public void map(final Mapper mapper) {
40 mapper.map(this);
41 }
42
43 @Override
44 public int hashCode() {
45 return new HashCodeBuilder()
46 .appendSuper(super.hashCode())
47 .append(usernameAttribute)
48 .toHashCode();
49 }
50
51 @Override
52 public boolean equals(final Object obj) {
53 if (obj == null) {
54 return false;
55 }
56 if (obj == this) {
57 return true;
58 }
59 if (obj.getClass() != getClass()) {
60 return false;
61 }
62 PrincipalAttributeUsernameAttributeProviderConf conf = (PrincipalAttributeUsernameAttributeProviderConf) obj;
63 return new EqualsBuilder()
64 .appendSuper(super.equals(obj))
65 .append(this.usernameAttribute, conf.usernameAttribute)
66 .isEquals();
67 }
68 }