liblldp: final parameters
[controller.git] / opendaylight / commons / liblldp / src / main / java / org / opendaylight / controller / liblldp / CustomTLVKey.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, 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.controller.liblldp;
10
11 public class CustomTLVKey {
12
13     private int oui;
14     private byte subtype;
15
16     /**
17      * @param oui
18      * @param subtype
19      */
20     public CustomTLVKey(final int oui, final byte subtype) {
21         this.oui = oui;
22         this.subtype = subtype;
23     }
24
25     /**
26      * @return the oui
27      */
28     public int getOui() {
29         return oui;
30     }
31
32     /**
33      * @return the subtype
34      */
35     public byte getSubtype() {
36         return subtype;
37     }
38
39     @Override
40     public int hashCode() {
41         final int prime = 31;
42         int result = 1;
43         result = prime * result + oui;
44         result = prime * result + subtype;
45         return result;
46     }
47
48     @Override
49     public boolean equals(final Object obj) {
50         if (this == obj) {
51             return true;
52         }
53
54         if (obj == null) {
55             return false;
56         }
57
58         if (getClass() != obj.getClass()) {
59             return false;
60         }
61
62         CustomTLVKey other = (CustomTLVKey) obj;
63         if (oui != other.oui) {
64             return false;
65         }
66
67         if (subtype != other.subtype) {
68             return false;
69         }
70
71         return true;
72     }
73
74 }