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
9 package org.opendaylight.protocol.pcep.tlv;
11 import org.opendaylight.protocol.pcep.PCEPTlv;
12 import org.opendaylight.protocol.pcep.concepts.LSPSymbolicName;
15 * Structure of LSP Symbolic Name Tlv.
18 * href="http://tools.ietf.org/html/draft-crabbe-pce-stateful-pce-02#section-7.2.1">The
19 * LSP Symbolic Name TLV</a>
21 public class LSPSymbolicNameTlv implements PCEPTlv {
22 private static final long serialVersionUID = 2525226814028262452L;
23 private final LSPSymbolicName symbolicName;
26 * Constructs new LSP Symbolic Name TLV.
31 public LSPSymbolicNameTlv(LSPSymbolicName symbolicName) {
32 this.symbolicName = symbolicName;
36 * Gets {@link LSPSymbolicName}.
38 * @return LSPSymbolicName
40 public LSPSymbolicName getSymbolicName() {
41 return this.symbolicName;
45 public int hashCode() {
48 result = prime * result + ((this.symbolicName == null) ? 0 : this.symbolicName.hashCode());
53 public boolean equals(Object obj) {
58 if (this.getClass() != obj.getClass())
60 final LSPSymbolicNameTlv other = (LSPSymbolicNameTlv) obj;
61 if (this.symbolicName == null) {
62 if (other.symbolicName != null)
64 } else if (!this.symbolicName.equals(other.symbolicName))
70 public String toString() {
71 final StringBuilder builder = new StringBuilder();
72 builder.append("LSPSymbolicNameTlv [symbolicName=");
73 builder.append(this.symbolicName);
75 return builder.toString();