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 org.opendaylight.protocol.concepts.IPv4Address;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.UnnumberedSubobject;
15 * Structure of unnumbered Iterface Subobject.
17 * @see <a href="http://tools.ietf.org/html/rfc3477">Section 4: Signalling Unnumbered Links in EROs</a>
19 public class RROUnnumberedInterfaceSubobject extends ReportedRouteSubobject {
20 private final UnnumberedSubobject interfaceID;
21 private final IPv4Address routerID;
24 * Constructs new Unnumbered Interface Subobject.
26 * @param routerID IPv4Address
27 * @param interfaceID UnnumberedInterfaceIdentifier
29 public RROUnnumberedInterfaceSubobject(final IPv4Address routerID, final UnnumberedSubobject interfaceID) {
31 this.routerID = routerID;
32 this.interfaceID = interfaceID;
36 * Gets {@link IPv4Address} representation of router ID.
40 public IPv4Address getRouterID() {
45 * Gets {@link UnnumberedSubobject} representation of Interface ID.
47 * @return UnnumberedSubobject
49 public UnnumberedSubobject getInterfaceID() {
50 return this.interfaceID;
54 public int hashCode() {
57 result = prime * result + ((this.interfaceID == null) ? 0 : this.interfaceID.hashCode());
58 result = prime * result + ((this.routerID == null) ? 0 : this.routerID.hashCode());
63 public boolean equals(final Object obj) {
68 if (this.getClass() != obj.getClass())
70 final RROUnnumberedInterfaceSubobject other = (RROUnnumberedInterfaceSubobject) obj;
71 if (this.interfaceID == null) {
72 if (other.interfaceID != null)
74 } else if (!this.interfaceID.equals(other.interfaceID))
76 if (this.routerID == null) {
77 if (other.routerID != null)
79 } else if (!this.routerID.equals(other.routerID))
85 public String toString() {
86 final StringBuilder builder = new StringBuilder();
87 builder.append("RROUnnumberedInterfaceSubobject [interfaceID=");
88 builder.append(this.interfaceID);
89 builder.append(", routerID=");
90 builder.append(this.routerID);
92 return builder.toString();