private boolean checkValues() { if (type.isValid(value, mask) == false) { String maskString = (mask == null) ? "null" : ("0x" + Integer .toHexString(Integer.parseInt(mask.toString()))); String error = "Invalid match field's value or mask assignement.For field: " + type.id() + " Expected: " + type.getRange() + ", Got:(0x" + Integer.toHexString(Integer.parseInt(value.toString())) + "," + maskString + ")"; throwException(error); return false; } return true; }
private boolean checkValueType() { if (type.isCongruentType(value, mask) == false) { String valueClass = (value == null) ? "null" : value.getClass().getSimpleName(); String maskClass = (mask == null) ? "null" : mask.getClass().getSimpleName(); String error = "Invalid match field's value or mask types.For field: " + type.id() + " Expected:" + type.dataType().getSimpleName() + " or equivalent," + " Got:(" + valueClass + "," + maskClass + ")"; throwException(error); return false; } return true; }
row.put("nodeName", desc); if (match.isPresent(MatchType.IN_PORT)) { row.put(MatchType.IN_PORT.id(), ((NodeConnector) flow.getMatch() .getField(MatchType.IN_PORT).getValue()) .getNodeConnectorIdAsString()); } else { row.put(MatchType.IN_PORT.id(), "*"); row.put(MatchType.DL_SRC.id(), (HexEncode.bytesToHexString(((byte[]) flow.getMatch() .getField(MatchType.DL_SRC).getValue())))); } else { row.put(MatchType.DL_SRC.id(), "*"); row.put(MatchType.DL_DST.id(), (HexEncode.bytesToHexString(((byte[]) flow.getMatch() .getField(MatchType.DL_DST).getValue())))); } else { row.put(MatchType.DL_DST.id(), "*"); row.put(MatchType.DL_TYPE.id(), EtherTypes.getEtherTypeName(((Short) flow.getMatch() .getField(MatchType.DL_TYPE).getValue()))); } else { row.put(MatchType.DL_TYPE.id(), "*"); if (((Short) flow.getMatch().getField(MatchType.DL_VLAN).getValue()) .shortValue() < 0) { row.put(MatchType.DL_VLAN.id(), "0");