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.subobject;
11 * Structure of Shared Risk Link Group Subobject. Defined in RFC5521.
13 * @see <a href="http://tools.ietf.org/html/rfc5521#section-2.1.1">Exclude Route Object definition</a>
15 public class XROSRLGSubobject extends ExcludeRouteSubobject {
17 private final XROSubobjectAttribute attribute;
19 // private final SharedRiskLinkGroup srlgId;
22 * Constructs new Shared Risk Link Group Subobject.
24 * @param srlgId SharedRiskLinkGroup
25 * @param mandatory boolean
27 public XROSRLGSubobject(final boolean mandatory) {
29 this.attribute = XROSubobjectAttribute.SRLG;
30 // this.srlgId = srlgId;
34 * Gets the Shared Risk Link Group.
36 * @return SharedRiskLinkGroup
38 // public SharedRiskLinkGroup getSrlgId() {
39 // return this.srlgId;
43 * Gets the attribute of the subobject
45 * @return the attribute
47 public XROSubobjectAttribute getAttribute() {
48 return this.attribute;
52 public String toString() {
53 final StringBuilder builder = new StringBuilder();
54 builder.append("XROSRLGSubobject [attribute=");
55 builder.append(this.attribute);
56 builder.append(", mandatory=");
57 builder.append(this.mandatory);
59 return builder.toString();
63 public int hashCode() {
65 int result = super.hashCode();
66 result = prime * result + ((this.attribute == null) ? 0 : this.attribute.hashCode());
71 public boolean equals(final Object obj) {
74 if (!super.equals(obj))
76 if (this.getClass() != obj.getClass())
78 final XROSRLGSubobject other = (XROSRLGSubobject) obj;
79 if (this.attribute != other.attribute)