2 * Copyright (c) 2013 Cisco Systems, 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.protocol.pcep.tlv;
10 import org.opendaylight.protocol.pcep.PCEPTlv;
13 * Structure of LSP Cleanup Tlv
15 * @see <a href="http://www.ietf.org/id/draft-crabbe-pce-pce-initiated-lsp-00.txt#section-6.2.1">LSP-CLEANUP TLV</a>
17 public class LSPCleanupTlv implements PCEPTlv {
19 private static final long serialVersionUID = -2540695596612553355L;
21 private final int timeout;
24 * Creates new LSP Cleanup Tlv.
27 public LSPCleanupTlv(int timeout) {
28 if (timeout < 0 || timeout > Integer.MAX_VALUE)
29 throw new IllegalArgumentException("Timeout (" + timeout + ") cannot be negative or bigger than 2^31 -1.");
30 this.timeout = timeout;
36 public final int getTimeout() {
41 * @see java.lang.Object#hashCode()
44 public int hashCode() {
47 result = prime * result + this.timeout;
52 * @see java.lang.Object#equals(java.lang.Object)
55 public boolean equals(Object obj) {
60 if (!(obj instanceof LSPCleanupTlv))
62 final LSPCleanupTlv other = (LSPCleanupTlv) obj;
63 if (this.timeout != other.timeout)
69 * @see java.lang.Object#toString()
72 public String toString() {
73 final StringBuilder builder = new StringBuilder();
74 builder.append("LSPCleanupTlv [timeout=");
75 builder.append(this.timeout);
77 return builder.toString();