/** * Checks if the passed value is in the valid range for this action * * @param value * @return boolean */ protected void checkValue(int value) { if (type.isValidTarget(value) == false) { isValid = false; throwValueException(value); } }
public SetTpSrc(int port) { type = ActionType.SET_TP_SRC; this.port = port; checkValue(port); }
public SetDlType(int dlType) { type = ActionType.SET_DL_TYPE; this.dlType = dlType; checkValue(dlType); }
public PushVlan(int tag, int pcp, int cfi, int vlanId) { type = ActionType.PUSH_VLAN; this.tag = tag; this.cfi = cfi; this.pcp = pcp; this.vlanId = vlanId; this.tci = createTci(); this.header = createHeader(); runChecks(); }
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + port; return result; }
/** * Returns the id of this action * * @return String */ public String getId() { return type.getId(); }
public SetVlanCfi(int cfi) { type = ActionType.SET_VLAN_CFI; this.cfi = cfi; checkValue(cfi); }
public SetVlanId(int vlanId) { type = ActionType.SET_VLAN_ID; this.vlanId = vlanId; checkValue(vlanId); }
@Override public String toString() { return this.getStringValue(); } }
public SetNwTos(int tos) { type = ActionType.SET_NW_TOS; this.tos = tos; checkValue(tos); }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((type == null) ? 0 : type.calculateConsistentHashCode()); return result; }
public SetTpDst(int port) { type = ActionType.SET_TP_DST; this.port = port; checkValue(port); }
/** * Checks if the passed value is in the valid range for the passed action * type This method is used for complex Action types which are * * @param value * @return boolean */ protected void checkValue(ActionType type, int value) { if (type.isValidTarget(value) == false) { isValid = false; throwValueException(value); } }
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + dlType; return result; }
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + pcp; return result; }
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + port; return result; }
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + cfi; result = prime * result + pcp; result = prime * result + tag; result = prime * result + vlanId; return result; }
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + tos; return result; }
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + vlanId; return result; }
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + cfi; return result; }