Merge "Randomize port to allow concurrent execution"
[bgpcep.git] / pcep / api / src / main / java / org / opendaylight / protocol / pcep / tlv / ReqMissingTlv.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.protocol.pcep.tlv;
10
11 import org.opendaylight.protocol.pcep.PCEPTlv;
12
13 /**
14  * Structure of Request Missing Tlv.
15  * 
16  * @see <a href="http://tools.ietf.org/html/rfc5440#section-7.15">PCEP-ERROR
17  *      Object</a> - defined in text (Error-type=7)
18  */
19 public class ReqMissingTlv implements PCEPTlv {
20         private static final long serialVersionUID = -3910927830017195746L;
21         private final long requestID;
22
23         /**
24          * Constructs new Request Missing Tlv.
25          * 
26          * @param requestID
27          *            long
28          */
29         public ReqMissingTlv(long requestID) {
30                 this.requestID = requestID;
31         }
32
33         /**
34          * gets long representation of Requested ID.
35          * 
36          * @return long
37          */
38         public long getRequestID() {
39                 return this.requestID;
40         }
41
42         @Override
43         public int hashCode() {
44                 final int prime = 31;
45                 int result = 1;
46                 result = prime * result + (int) (this.requestID ^ (this.requestID >>> 32));
47                 return result;
48         }
49
50         @Override
51         public boolean equals(Object obj) {
52                 if (this == obj)
53                         return true;
54                 if (obj == null)
55                         return false;
56                 if (this.getClass() != obj.getClass())
57                         return false;
58                 final ReqMissingTlv other = (ReqMissingTlv) obj;
59                 if (this.requestID != other.requestID)
60                         return false;
61                 return true;
62         }
63
64         @Override
65         public String toString() {
66                 final StringBuilder builder = new StringBuilder();
67                 builder.append("ReqMissingTlv [requestID=");
68                 builder.append(this.requestID);
69                 builder.append("]");
70                 return builder.toString();
71         }
72
73 }