Revert "BUG-47 : unfinished PCEP migration to generated DTOs."
[bgpcep.git] / pcep / api / src / main / java / org / opendaylight / protocol / pcep / tlv / OverloadedDurationTlv.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 Overloaded Duratioon Tlv.
15  * 
16  * @see <a href="http://tools.ietf.org/html/rfc5440#section-7.14">NOTIFICATION
17  *      Object</a> - defined in text
18  */
19 public class OverloadedDurationTlv implements PCEPTlv {
20         private static final long serialVersionUID = -5829314427598008054L;
21         private final int value;
22
23         /**
24          * Construct new Overloaded Duration Tlv.
25          * 
26          * @param value
27          *            int
28          */
29         public OverloadedDurationTlv(int value) {
30                 this.value = value;
31         }
32
33         /**
34          * Gets Integer representation of Overloade Duration Value.
35          * 
36          * @return int
37          */
38         public int getValue() {
39                 return this.value;
40         }
41
42         @Override
43         public int hashCode() {
44                 final int prime = 31;
45                 int result = 1;
46                 result = prime * result + this.value;
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 OverloadedDurationTlv other = (OverloadedDurationTlv) obj;
59                 if (this.value != other.value)
60                         return false;
61                 return true;
62         }
63
64         @Override
65         public String toString() {
66                 final StringBuilder builder = new StringBuilder();
67                 builder.append("OverloadedDurationTlv [value=");
68                 builder.append(this.value);
69                 builder.append("]");
70                 return builder.toString();
71         }
72
73 }