1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.syncope.common.keymaster.client.api.model;
20
21 import java.io.Serializable;
22 import org.apache.commons.lang3.builder.EqualsBuilder;
23 import org.apache.commons.lang3.builder.HashCodeBuilder;
24
25 public class NetworkService implements Serializable {
26
27 private static final long serialVersionUID = 7144725980960412224L;
28
29 public enum Type {
30 CORE,
31 CONSOLE,
32 ENDUSER,
33 SRA,
34 WA
35
36 }
37
38 private Type type;
39
40 private String address;
41
42 public Type getType() {
43 return type;
44 }
45
46 public void setType(final Type type) {
47 this.type = type;
48 }
49
50 public String getAddress() {
51 return address;
52 }
53
54 public void setAddress(final String address) {
55 this.address = address;
56 }
57
58 @Override
59 public int hashCode() {
60 return new HashCodeBuilder().
61 append(type).
62 append(address).
63 build();
64 }
65
66 @Override
67 public boolean equals(final Object obj) {
68 if (this == obj) {
69 return true;
70 }
71 if (obj == null) {
72 return false;
73 }
74 if (getClass() != obj.getClass()) {
75 return false;
76 }
77 final NetworkService other = (NetworkService) obj;
78 return new EqualsBuilder().
79 append(type, other.type).
80 append(address, other.address).
81 build();
82 }
83
84 @Override
85 public String toString() {
86 return "NetworkService{"
87 + "type=" + type
88 + ", address=" + address
89 + '}';
90 }
91 }