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 * The Order TLV is an optional TLV in the RP object, that indicates the order
14 * in which the old TE LSP must be removed and the new TE LSP must be setup
15 * during a reoptimization. It is carried in the PCRep message in response to a
16 * reoptimization request.
18 * @see <a href="http://tools.ietf.org/html/rfc5557#section-5.4">The Order
19 * Response [RFC5557]</a>
21 public class OrderTlv implements PCEPTlv {
23 private static final long serialVersionUID = 4275350142878198146L;
25 private final long deleteOrder;
26 private final long setupOrder;
29 * Constructs new Order tlv with all mandatory objects.
36 public OrderTlv(long deleteOrder, long setupOrder) {
38 this.deleteOrder = deleteOrder;
39 this.setupOrder = setupOrder;
43 * Gets the delete order
45 * @return the delete order
47 public long getDeleteOrder() {
48 return this.deleteOrder;
52 * Gets the setup order
54 * @return the setup order
56 public long getSetupOrder() {
57 return this.setupOrder;
61 public String toString() {
62 final StringBuilder builder = new StringBuilder();
63 builder.append("OrderTlv [deleteOrder=");
64 builder.append(this.deleteOrder);
65 builder.append(", setupOrder=");
66 builder.append(this.setupOrder);
68 return builder.toString();
72 public int hashCode() {
75 result = prime * result + (int) (this.deleteOrder ^ (this.deleteOrder >>> 32));
76 result = prime * result + (int) (this.setupOrder ^ (this.setupOrder >>> 32));
81 public boolean equals(Object obj) {
86 if (this.getClass() != obj.getClass())
88 final OrderTlv other = (OrderTlv) obj;
89 if (this.deleteOrder != other.deleteOrder)
91 if (this.setupOrder != other.setupOrder)