Merge "support map request serialization TELSDN-378: #close Signed-off-by: David...
[lispflowmapping.git] / mappingservice / api / src / main / java / org / opendaylight / lispflowmapping / type / lisp / address / LispDistinguishedNameAddress.java
1 package org.opendaylight.lispflowmapping.type.lisp.address;
2
3 import org.opendaylight.lispflowmapping.type.AddressFamilyNumberEnum;
4
5 public class LispDistinguishedNameAddress extends LispAddress {
6
7     private String distinguishedName;
8
9     public LispDistinguishedNameAddress(String distinguishedName) {
10         super(AddressFamilyNumberEnum.DISTINGUISHED_NAME);
11         this.distinguishedName = distinguishedName;
12     }
13
14     public String getDistinguishedName() {
15         return distinguishedName;
16     }
17
18     public void setDistinguishedName(String distinguishedName) {
19         this.distinguishedName = distinguishedName;
20     }
21
22     @Override
23     public int hashCode() {
24         final int prime = 31;
25         int result = super.hashCode();
26         result = prime * result + ((distinguishedName == null) ? 0 : distinguishedName.hashCode());
27         return result;
28     }
29
30     @Override
31     public boolean equals(Object obj) {
32         if (this == obj)
33             return true;
34         if (!super.equals(obj))
35             return false;
36         if (getClass() != obj.getClass())
37             return false;
38         LispDistinguishedNameAddress other = (LispDistinguishedNameAddress) obj;
39         if (distinguishedName == null) {
40             if (other.distinguishedName != null)
41                 return false;
42         } else if (!distinguishedName.equals(other.distinguishedName))
43             return false;
44         return true;
45     }
46
47 }