Rename static final variable 'logger' to 'LOG'
[lispflowmapping.git] / mappingservice / api / src / main / java / org / opendaylight / lispflowmapping / interfaces / dao / MappingValueKey.java
1 /*
2  * Copyright (c) 2014 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.interfaces.dao;
10
11 /**
12  * A value in the mapping service DAO
13  *
14  * @param <V>
15  *            The value type.
16  */
17 public class MappingValueKey<V> {
18     private String key;
19
20     public MappingValueKey(String key) {
21         this.key = key;
22     }
23
24     public String getKey() {
25         return key;
26     }
27
28     @Override
29     public int hashCode() {
30         final int prime = 31;
31         int result = 1;
32         result = prime * result + ((key == null) ? 0 : key.hashCode());
33         return result;
34     }
35
36     @Override
37     public boolean equals(Object obj) {
38         if (this == obj)
39             return true;
40         if (obj == null)
41             return false;
42         if (getClass() != obj.getClass())
43             return false;
44         MappingValueKey<?> other = (MappingValueKey<?>) obj;
45         if (key == null) {
46             if (other.key != null)
47                 return false;
48         } else if (!key.equals(other.key))
49             return false;
50         return true;
51     }
52 }