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;
16 * @file Capabilities.java
18 * @brief Class representing capabilities
20 * Describes supported capabilities
23 public class Capabilities extends Property {
24 private static final long serialVersionUID = 1L;
25 @XmlElement(name="value")
26 private int capabilitiesValue;
28 public enum CapabilitiesType {
29 FLOW_STATS_CAPABILITY(1<<0),
30 TABLE_STATS_CAPABILITY(1<<1),
31 PORT_STATS_CAPABILITY(1<<2),
33 RSVD_CAPABILITY(1<<4),
34 IP_REASSEM_CAPABILITY(1<<5),
35 QUEUE_STATS_CAPABILITY(1<<6),
36 ARP_MATCH_IP_CAPABILITY(1<<7);
38 CapabilitiesType(int val) {
41 public int getValue() {
46 public static final String CapabilitiesPropName = "capabilities";
48 * Construct a Capabilities property
50 * @param capabilities the Capabilities value
51 * @return Constructed object
53 public Capabilities(int capabilities) {
54 super(CapabilitiesPropName);
55 this.capabilitiesValue = capabilities;
59 * Private constructor used for JAXB mapping
61 private Capabilities() {
62 super(CapabilitiesPropName);
63 this.capabilitiesValue = 0;
67 public Capabilities clone() {
68 return new Capabilities(this.capabilitiesValue);
71 public int getValue() {
72 return this.capabilitiesValue;
76 public int hashCode() {
78 int result = super.hashCode();
79 result = prime * result + capabilitiesValue;
84 public boolean equals(Object obj) {
87 if (!super.equals(obj))
89 if (getClass() != obj.getClass())
91 Capabilities other = (Capabilities) obj;
92 if (capabilitiesValue != other.capabilitiesValue)
98 public String toString() {
99 return "Capabilities[" + capabilitiesValue + "]";
103 public String getStringValue() {
104 return Integer.toHexString(capabilitiesValue);