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.interfaces.dao;
11 * A mapping service entry in the DAO.
14 * The type of the mapping key.
16 public class MappingEntry<V> {
17 private MappingValueKey<V> mappingValueKey;
20 public MappingEntry(String key, V value) {
21 this.mappingValueKey = new MappingValueKey<V>(key);
25 public String getKey() {
26 return mappingValueKey.getKey();
34 public int hashCode() {
37 result = prime * result + ((mappingValueKey == null) ? 0 : mappingValueKey.hashCode());
38 result = prime * result + ((value == null) ? 0 : value.hashCode());
43 public boolean equals(Object obj) {
50 if (getClass() != obj.getClass()) {
53 MappingEntry other = (MappingEntry) obj;
54 if (mappingValueKey == null) {
55 if (other.mappingValueKey != null) {
58 } else if (!mappingValueKey.equals(other.mappingValueKey)) {
62 if (other.value != null) {
65 } else if (!value.equals(other.value)) {
72 public String toString() {
73 return "MappingEntry: " + value.toString();