X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fsal%2Fapi%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fcore%2FActions.java;h=c26800890bb933d4dd5702dda513bcdec4b37e5f;hb=5aab0b90a2383de33cb98382e138f64c0b848674;hp=6fb38a3a90279a898786e5c1ed1f088ad6cd5488;hpb=a3a28e8138fa25170b01e6b51a44490f002f6e91;p=controller.git diff --git a/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/Actions.java b/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/Actions.java index 6fb38a3a90..c26800890b 100644 --- a/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/Actions.java +++ b/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/Actions.java @@ -12,9 +12,6 @@ package org.opendaylight.controller.sal.core; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; - /** * @file Actions.java * @@ -25,33 +22,33 @@ import org.apache.commons.lang3.builder.HashCodeBuilder; @XmlRootElement public class Actions extends Property { - private static final long serialVersionUID = 1L; - @XmlElement + private static final long serialVersionUID = 1L; + @XmlElement(name="value") private int actionsValue; - - public enum ActionType { - OUTPUT_PORT_ACTION(1<<0), - VLAN_VID_ACTION(1<<1), - VLAN_PCP_ACTION(1<<2), - VLAN_STRIP_ACTION(1<<3), - DLSRC_ACTION(1<<4), - DLDST_ACTION(1<<5), - NWSRC_ACTION(1<<6), - NWDST_ACTION(1<<7), - NWTOS_ACTION(1<<8), - TPTSRC_ACTION(1<<9), - TPTDST_ACTION(1<<10), - ENQUEUE_ACTION(1<<11), - VENDOR_ACTION(0xffff); - private final int at; - ActionType(int val) { - this.at = val; - } - public int getValue() { - return at; - } + + public enum ActionType { + OUTPUT_PORT_ACTION(1<<0), + VLAN_VID_ACTION(1<<1), + VLAN_PCP_ACTION(1<<2), + VLAN_STRIP_ACTION(1<<3), + DLSRC_ACTION(1<<4), + DLDST_ACTION(1<<5), + NWSRC_ACTION(1<<6), + NWDST_ACTION(1<<7), + NWTOS_ACTION(1<<8), + TPTSRC_ACTION(1<<9), + TPTDST_ACTION(1<<10), + ENQUEUE_ACTION(1<<11), + VENDOR_ACTION(0xffff); + private final int at; + ActionType(int val) { + this.at = val; + } + public int getValue() { + return at; + } } - + public static final String ActionsPropName = "actions"; /** * Construct a actions property @@ -72,23 +69,36 @@ public class Actions extends Property { this.actionsValue = 0; } + @Override public Actions clone() { return new Actions(this.actionsValue); } - + public int getValue() { - return this.actionsValue; + return this.actionsValue; } - - + + @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + final int prime = 31; + int result = super.hashCode(); + result = prime * result + actionsValue; + return result; } @Override public boolean equals(Object obj) { - return EqualsBuilder.reflectionEquals(this, obj); + if (this == obj) + return true; + if (!super.equals(obj)) + return false; + if (getClass() != obj.getClass()) + return false; + Actions other = (Actions) obj; + if (actionsValue != other.actionsValue) + return false; + return true; } @Override