public static List<IpPermission> buildRules(List<Allow> allowRules){
  ArrayList<IpPermission> awsRules=new ArrayList<>();
  for (  Allow rule : allowRules) {
    for (    String port : rule.ports) {
      int fromPort;
      int toPort;
      if (port.contains("-")) {
        String[] ports=port.split("-");
        fromPort=Integer.parseInt(ports[0]);
        toPort=Integer.parseInt(ports[1]);
      }
 else {
        fromPort=Integer.parseInt(port);
        toPort=fromPort;
      }
      awsRules.add(createRule(fromPort,toPort,rule.ipRange,rule.protocol));
    }
  }
  return awsRules;
}

public static List < IpPermission > buildRules ( List < Allow > allowRules ) { ArrayList < IpPermission > awsRules = new ArrayList < > ( ) ; for ( Allow rule : allowRules ) { for ( String port : rule . ports ) { int fromPort ; int toPort ; if ( port . contains ( "-" ) ) { String [ ] ports = port . split ( "-" ) ; fromPort = Integer . parseInt ( ports [ 0 ] ) ; toPort = Integer . parseInt ( ports [ 1 ] ) ; } else { fromPort = Integer . parseInt ( port ) ; toPort = fromPort ; } awsRules . add ( createRule ( fromPort , toPort , rule . ipRange , rule . protocol ) ) ; } } return awsRules ; }
builds the white list rules for the firewall
