2 * Copyright (c) 2014 Contextream, Inc. and others. All rights reserved.
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
8 package org.opendaylight.lispflowmapping.implementation.dao;
10 import org.opendaylight.lispflowmapping.implementation.util.LispAFIConvertor;
11 import org.opendaylight.lispflowmapping.implementation.util.MaskUtil;
12 import org.opendaylight.lispflowmapping.interfaces.dao.IMappingServiceKey;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.control.plane.rev150314.LispAFIAddress;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.control.plane.rev150314.lispaddress.LispAddressContainer;
16 public class MappingServiceNoMaskKey implements IMappingServiceKey {
18 private LispAddressContainer EID;
20 public MappingServiceNoMaskKey(LispAddressContainer lispAddressContainer) {
21 this.EID = lispAddressContainer;
24 public LispAddressContainer getEID() {
28 public int getMask() {
29 LispAFIAddress eidAFIAddress = LispAFIConvertor.toAFI(EID);
30 if (MaskUtil.isMaskable(eidAFIAddress)) {
31 return MaskUtil.getMaxMask(eidAFIAddress);
38 public int hashCode() {
41 result = prime * result + ((EID == null) ? 0 : EID.hashCode());
46 public boolean equals(Object obj) {
51 if (getClass() != obj.getClass())
53 MappingServiceNoMaskKey other = (MappingServiceNoMaskKey) obj;
55 if (other.EID != null)
57 } else if (!EID.equals(other.EID))
63 public String toString() {
64 return EID.toString();