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.subobject;
11 import com.google.common.base.Objects.ToStringHelper;
14 * Structure of Generalized Label subobject
16 * @see <a href="http://tools.ietf.org/html/rfc3473#section-2.4">2.4. Waveband
17 * Switching Object </a>
19 public class EROWavebandSwitchingLabelSubobject extends EROLabelSubobject {
21 private final long wavebandId;
23 private final long startLabel;
25 private final long endLabel;
27 public EROWavebandSwitchingLabelSubobject(long wavebandId, long startLabel, long endLabel, boolean upStream, boolean loose) {
29 this.wavebandId = wavebandId;
30 this.startLabel = startLabel;
31 this.endLabel = endLabel;
34 public long getWavebandId() {
35 return this.wavebandId;
38 public long getStartLabel() {
39 return this.startLabel;
42 public long getEndLabel() {
47 public int hashCode() {
49 int result = super.hashCode();
50 result = prime * result + (int) (this.endLabel ^ (this.endLabel >>> 32));
51 result = prime * result + (int) (this.startLabel ^ (this.startLabel >>> 32));
52 result = prime * result + (int) (this.wavebandId ^ (this.wavebandId >>> 32));
57 public boolean equals(Object obj) {
60 if (!super.equals(obj))
62 if (this.getClass() != obj.getClass())
64 final EROWavebandSwitchingLabelSubobject other = (EROWavebandSwitchingLabelSubobject) obj;
65 if (this.endLabel != other.endLabel)
67 if (this.startLabel != other.startLabel)
69 if (this.wavebandId != other.wavebandId)
75 protected ToStringHelper addToStringAttributes(ToStringHelper toStringHelper) {
76 toStringHelper.add("wavebandId", this.wavebandId);
77 toStringHelper.add("startLabel", this.startLabel);
78 toStringHelper.add("endLabel", this.endLabel);
79 return super.addToStringAttributes(toStringHelper);