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 java.util.List;
12 import org.opendaylight.protocol.pcep.PCEPOFCodes;
13 import org.opendaylight.protocol.pcep.PCEPTlv;
16 * It MAY be carried within an OPEN object sent by a PCE in an Open message to a
17 * PCEP peer so as to indicate the list of supported objective functions.
19 * @see <a href="http://tools.ietf.org/html/rfc5541#section-2.1">OF-List TLV</a>
21 public class OFListTlv implements PCEPTlv {
22 private static final long serialVersionUID = 3409582385994162451L;
24 private final List<PCEPOFCodes> ofCodes;
27 * Constructs new objective functions list tlv
30 * lit of objective functions
32 public OFListTlv(List<PCEPOFCodes> ofCodes) {
34 this.ofCodes = ofCodes;
38 * Gets list of objective functions
40 * @return list of objective functions
42 public List<PCEPOFCodes> getOfCodes() {
47 public int hashCode() {
50 result = prime * result + ((this.ofCodes == null) ? 0 : this.ofCodes.hashCode());
55 public boolean equals(Object obj) {
60 if (this.getClass() != obj.getClass())
62 final OFListTlv other = (OFListTlv) obj;
63 if (this.ofCodes == null) {
64 if (other.ofCodes != null)
66 } else if (!this.ofCodes.equals(other.ofCodes))
72 public String toString() {
73 final StringBuilder builder = new StringBuilder();
74 builder.append("OFListTlv [ofCodes=");
75 builder.append(this.ofCodes);
77 return builder.toString();