Fix star import and enable checkstyle rule to prevent it.
[controller.git] / opendaylight / sal / api / src / main / java / org / opendaylight / controller / sal / action / Action.java
index 8fc8fc16bf59b9f7248b093070783657f834c066..1ff7ea1444052e84d36e4cf80b440ad9159cd01f 100644 (file)
@@ -8,33 +8,28 @@
 
 package org.opendaylight.controller.sal.action;
 
-import java.io.Serializable;
-
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlSeeAlso;
-import javax.xml.bind.annotation.XmlTransient;
+import java.io.Serializable;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+
 /**
  * Represents the generic action to be applied to the matched
  * frame/packet/message
  */
 @XmlRootElement
 @XmlAccessorType(XmlAccessType.NONE)
-@XmlSeeAlso({ Controller.class, Drop.class, Flood.class, FloodAll.class, HwPath.class, Loopback.class, Output.class,
-    PopVlan.class, PushVlan.class, SetDlDst.class, SetDlSrc.class, SetDlType.class, SetNwDst.class, SetNwSrc.class,
-    SetNwTos.class, SetTpDst.class, SetTpSrc.class, SetVlanCfi.class, SetVlanId.class, SetVlanPcp.class,
-    SwPath.class })
 public abstract class Action implements Serializable {
     private static final long serialVersionUID = 1L;
     private static final Logger logger = LoggerFactory.getLogger(Action.class);
     private static boolean debug = false; // Enable to find where in the code an
     // invalid assignment is made
-    @XmlTransient
+    @XmlElement
     protected ActionType type;
     private transient boolean isValid = true;
 
@@ -42,11 +37,6 @@ public abstract class Action implements Serializable {
     public Action() {
     }
 
-    /*
-     * public Action (ActionType type, Object value) { this.type = type;
-     * this.value = value; this.isValid = true; }
-     */
-
     /**
      * Checks if the passed value is in the valid range for this action
      *
@@ -124,7 +114,7 @@ public abstract class Action implements Serializable {
     public int hashCode() {
         final int prime = 31;
         int result = 1;
-        result = prime * result + ((type == null) ? 0 : type.hashCode());
+        result = prime * result + ((type == null) ? 0 : type.calculateConsistentHashCode());
         return result;
     }