1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.syncope.core.persistence.api.dao.search;
20
21 import org.apache.commons.lang3.builder.EqualsBuilder;
22 import org.apache.commons.lang3.builder.HashCodeBuilder;
23 import org.apache.commons.lang3.builder.ToStringBuilder;
24
25 public class RoleCond extends AbstractSearchCond {
26
27 private static final long serialVersionUID = 3581958527829522490L;
28
29 private String role;
30
31 public String getRole() {
32 return role;
33 }
34
35 public void setRole(final String role) {
36 this.role = role;
37 }
38
39 @Override
40 public final boolean isValid() {
41 return role != null;
42 }
43
44 @Override
45 public int hashCode() {
46 return new HashCodeBuilder().
47 append(role).
48 build();
49 }
50
51 @Override
52 public boolean equals(final Object obj) {
53 if (this == obj) {
54 return true;
55 }
56 if (obj == null) {
57 return false;
58 }
59 if (getClass() != obj.getClass()) {
60 return false;
61 }
62 final RoleCond other = (RoleCond) obj;
63 return new EqualsBuilder().
64 append(role, other.role).
65 build();
66 }
67
68 @Override
69 public String toString() {
70 return new ToStringBuilder(this).
71 append(role).
72 build();
73 }
74 }