1 package org.opendaylight.affinity.affinity;
3 import javax.xml.bind.annotation.XmlAccessType;
4 import javax.xml.bind.annotation.XmlAccessorType;
5 import javax.xml.bind.annotation.XmlElement;
6 import javax.xml.bind.annotation.XmlRootElement;
7 import java.io.Serializable;
9 import org.slf4j.Logger;
10 import org.slf4j.LoggerFactory;
14 * Represents the attribute associated with an affinity link.
17 @XmlAccessorType(XmlAccessType.NONE)
18 public abstract class AffinityAttribute implements Serializable {
19 private static final long serialVersionUID = 1L;
20 private static final Logger logger = LoggerFactory.getLogger(AffinityAttribute.class);
22 protected AffinityAttributeType type;
23 private transient boolean isValid = true;
25 /* Dummy constructor for JAXB */
26 public AffinityAttribute() {
29 public AffinityAttributeType getType() {
34 * Returns the id of this action
38 public String getId() {
43 public int hashCode() {
46 result = prime * result + ((type == null) ? 0 : type.calculateConsistentHashCode());
51 public boolean equals(Object obj) {
58 if (getClass() != obj.getClass()) {
61 AffinityAttribute other = (AffinityAttribute) obj;
62 if (type != other.type) {
69 public String toString() {
70 return type.toString();