3 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
5 * This program and the accompanying materials are made available under the
6 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
7 * and is available at http://www.eclipse.org/legal/epl-v10.html
10 package org.opendaylight.controller.sal.core;
12 import javax.xml.bind.annotation.XmlElement;
13 import javax.xml.bind.annotation.XmlRootElement;
15 import org.apache.commons.lang3.builder.EqualsBuilder;
16 import org.apache.commons.lang3.builder.HashCodeBuilder;
17 import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
20 * @file Capabilities.java
22 * @brief Class representing capabilities
24 * Describes supported capabilities
27 public class Capabilities extends Property {
28 private static final long serialVersionUID = 1L;
30 private int capabilitiesValue;
32 public enum CapabilitiesType {
33 FLOW_STATS_CAPABILITY(1<<0),
34 TABLE_STATS_CAPABILITY(1<<1),
35 PORT_STATS_CAPABILITY(1<<2),
37 RSVD_CAPABILITY(1<<4),
38 IP_REASSEM_CAPABILITY(1<<5),
39 QUEUE_STATS_CAPABILITY(1<<6),
40 ARP_MATCH_IP_CAPABILITY(1<<7);
42 CapabilitiesType(int val) {
45 public int getValue() {
50 public static final String CapabilitiesPropName = "capabilities";
52 * Construct a Capabilities property
54 * @param capabilities the Capabilities value
55 * @return Constructed object
57 public Capabilities(int capabilities) {
58 super(CapabilitiesPropName);
59 this.capabilitiesValue = capabilities;
63 * Private constructor used for JAXB mapping
65 private Capabilities() {
66 super(CapabilitiesPropName);
67 this.capabilitiesValue = 0;
70 public Capabilities clone() {
71 return new Capabilities(this.capabilitiesValue);
74 public int getValue() {
75 return this.capabilitiesValue;
79 public int hashCode() {
80 return HashCodeBuilder.reflectionHashCode(this);
84 public boolean equals(Object obj) {
85 return EqualsBuilder.reflectionEquals(this, obj);
89 public String toString() {
90 return "Capabilities[" + ReflectionToStringBuilder.toString(this) + "]";