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;
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;
66 public Capabilities clone() {
67 return new Capabilities(this.capabilitiesValue);
70 public int getValue() {
71 return this.capabilitiesValue;
75 public int hashCode() {
77 int result = super.hashCode();
78 result = prime * result + capabilitiesValue;
83 public boolean equals(Object obj) {
86 if (!super.equals(obj))
88 if (getClass() != obj.getClass())
90 Capabilities other = (Capabilities) obj;
91 if (capabilitiesValue != other.capabilitiesValue)
97 public String toString() {
98 return "Capabilities[" + capabilitiesValue + "]";