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;
10 import java.util.Arrays;
12 public class RROAttributesSubobject extends ReportedRouteSubobject {
14 private final byte[] attributes;
16 public RROAttributesSubobject(byte[] attributes) {
19 if (attributes.length % 4 != 0)
20 throw new IllegalArgumentException("Attributes have to be multiple of 4.");
22 this.attributes = attributes;
25 public byte[] getAttributes() {
26 return this.attributes;
30 public int hashCode() {
33 result = prime * result + Arrays.hashCode(this.attributes);
38 public boolean equals(Object obj) {
43 if (this.getClass() != obj.getClass())
45 final RROAttributesSubobject other = (RROAttributesSubobject) obj;
46 if (!Arrays.equals(this.attributes, other.attributes))
52 public String toString() {
53 final StringBuilder builder = new StringBuilder();
54 builder.append("RROAttributesSubobject [attributes=");
55 builder.append(Arrays.toString(this.attributes));
57 return builder.toString();