refactoring of listmappingservice into Northbound (future REST) and Southbound (LISP...
[lispflowmapping.git] / mappingservice / api / src / main / java / org / opendaylight / lispflowmapping / type / lisp / address / LispAddress.java
1 /*
2  * Copyright (c) 2013 Contextream, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.lispflowmapping.type.lisp.address;
10
11 import org.opendaylight.lispflowmapping.type.AddressFamilyNumberEnum;
12
13 public abstract class LispAddress {
14     private AddressFamilyNumberEnum afi;
15
16     protected LispAddress(AddressFamilyNumberEnum afi) {
17         this.afi = afi;
18     }
19
20     public AddressFamilyNumberEnum getAfi() {
21         return afi;
22     }
23     
24     
25
26     @Override
27     public int hashCode() {
28         final int prime = 31;
29         int result = 1;
30         result = prime * result + ((afi == null) ? 0 : afi.hashCode());
31         return result;
32     }
33
34     @Override
35     public boolean equals(Object obj) {
36         if (this == obj)
37             return true;
38         if (obj == null)
39             return false;
40         if (getClass() != obj.getClass())
41             return false;
42         LispAddress other = (LispAddress) obj;
43         if (afi != other.afi)
44             return false;
45         return true;
46     }
47
48 }