@Test public final void testIsPortsOfOneWithinTwo_onePortMinLtTwoPortMinOnePortMaxGtTwoPortMax() { SecurityRule one = createSecRuleWithMinMaxPort(4, 11); SecurityRule two = createSecRuleWithMinMaxPort(5, 10); assertFalse(SecRuleEntityDecoder.isPortsOfOneWithinTwo(one, two)); }
public static boolean isPortsOfOneWithinTwo(SecurityRule one, SecurityRule two) { Integer onePortMin = one.getPortRangeMin(); Integer onePortMax = one.getPortRangeMax(); Integer twoPortMin = two.getPortRangeMin(); Integer twoPortMax = two.getPortRangeMax(); if (twoPortMin == null && twoPortMax == null) { return true; } if ((onePortMin != null && twoPortMin != null && onePortMin >= twoPortMin) && (onePortMax != null && twoPortMax != null && onePortMax <= twoPortMax)) { return true; } return false; }
SecRuleEntityDecoder { public static boolean isPortsOfOneWithinTwo(SecurityRule one, SecurityRule two) { Integer onePortMin = one.getPortRangeMin(); Integer onePortMax = one.getPortRangeMax(); Integer twoPortMin = two.getPortRangeMin(); Integer twoPortMax = two.getPortRangeMax(); if (twoPortMin == null && twoPortMax == null) { return true; } if ((onePortMin != null && twoPortMin != null && onePortMin >= twoPortMin) && (onePortMax != null && twoPortMax != null && onePortMax <= twoPortMax)) { return true; } return false; } }
SecRuleEntityDecoder { public static boolean isPortsOfOneWithinTwo(SecurityRule one, SecurityRule two) { Integer onePortMin = one.getPortRangeMin(); Integer onePortMax = one.getPortRangeMax(); Integer twoPortMin = two.getPortRangeMin(); Integer twoPortMax = two.getPortRangeMax(); if (twoPortMin == null && twoPortMax == null) { return true; } if ((onePortMin != null && twoPortMin != null && onePortMin >= twoPortMin) && (onePortMax != null && twoPortMax != null && onePortMax <= twoPortMax)) { return true; } return false; } private  SecRuleEntityDecoder(); }
SecRuleEntityDecoder { public static boolean isPortsOfOneWithinTwo(SecurityRule one, SecurityRule two) { Integer onePortMin = one.getPortRangeMin(); Integer onePortMax = one.getPortRangeMax(); Integer twoPortMin = two.getPortRangeMin(); Integer twoPortMax = two.getPortRangeMax(); if (twoPortMin == null && twoPortMax == null) { return true; } if ((onePortMin != null && twoPortMin != null && onePortMin >= twoPortMin) && (onePortMax != null && twoPortMax != null && onePortMax <= twoPortMax)) { return true; } return false; } private  SecRuleEntityDecoder(); static ContractId getContractId(SecurityRule secRule); static ClassifierInstance getClassifierInstance(SecurityRule secRule); static ActionRef createActionRefFromActionChoice(ActionChoice action); static ClassifierRef getClassifierRef(SecurityRule secRule); static Direction getDirection(SecurityRule secRule); static Clause getClause(SecurityRule secRule); static boolean isEtherTypeOfOneWithinTwo(SecurityRule one, SecurityRule two); static boolean isProtocolOfOneWithinTwo(SecurityRule one, SecurityRule two); static boolean isPortsOfOneWithinTwo(SecurityRule one, SecurityRule two); static Long getEtherType(SecurityRule secRule); static Long getProtocol(SecurityRule secRule); }
SecRuleEntityDecoder { public static boolean isPortsOfOneWithinTwo(SecurityRule one, SecurityRule two) { Integer onePortMin = one.getPortRangeMin(); Integer onePortMax = one.getPortRangeMax(); Integer twoPortMin = two.getPortRangeMin(); Integer twoPortMax = two.getPortRangeMax(); if (twoPortMin == null && twoPortMax == null) { return true; } if ((onePortMin != null && twoPortMin != null && onePortMin >= twoPortMin) && (onePortMax != null && twoPortMax != null && onePortMax <= twoPortMax)) { return true; } return false; } private  SecRuleEntityDecoder(); static ContractId getContractId(SecurityRule secRule); static ClassifierInstance getClassifierInstance(SecurityRule secRule); static ActionRef createActionRefFromActionChoice(ActionChoice action); static ClassifierRef getClassifierRef(SecurityRule secRule); static Direction getDirection(SecurityRule secRule); static Clause getClause(SecurityRule secRule); static boolean isEtherTypeOfOneWithinTwo(SecurityRule one, SecurityRule two); static boolean isProtocolOfOneWithinTwo(SecurityRule one, SecurityRule two); static boolean isPortsOfOneWithinTwo(SecurityRule one, SecurityRule two); static Long getEtherType(SecurityRule secRule); static Long getProtocol(SecurityRule secRule);  }