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 P2MP Capability Tlv.
15 * @see <a href="http://tools.ietf.org/html/rfc6006#section-3.1.2">3.1.2. Open
16 * Message Extension [RFC6006]</a>
18 public class P2MPCapabilityTlv implements PCEPTlv {
19 private static final long serialVersionUID = -7959631526276210055L;
21 private final int value;
24 * Constructs new P2MP Capability Tlv.
26 public P2MPCapabilityTlv(int value) {
27 if (value < 0 || value > 65535)
28 throw new IllegalArgumentException("Value (" + value + ") cannot be negative or bigger than 2^16 -1.");
34 * Constructs new P2MP Capability Tlv, with value defaultly set to zero as
35 * mentioned in RFC6006.
37 public P2MPCapabilityTlv() {
42 * Gets integer value of P2MP Capability Tlv.
46 public int getValue() {
51 public int hashCode() {
54 result = prime * result + this.value;
59 public boolean equals(Object obj) {
64 if (this.getClass() != obj.getClass())
66 final P2MPCapabilityTlv other = (P2MPCapabilityTlv) obj;
67 if (this.value != other.value)
73 public String toString() {
74 final StringBuilder builder = new StringBuilder();
75 builder.append("P2MPCapablityTlv [value=");
76 builder.append(this.value);
78 return builder.toString();