> @@ -266,6 +266,12 @@ public static IPProtocol fromValue(String protocol) {
>        private final IPProtocol ipProtocol;
>        private final RangeSet<Integer> ports;
>  
> +      /* Some handy shortcuts */
> +      public static Rule permitTcpRule(Integer start, Integer end) { return 
> Rule.builder().IPProtocol(Firewall.Rule.IPProtocol.TCP).addPortRange(start, 
> end).build(); }
> +      public static Rule permitTcpRule(Integer port) { return 
> Rule.builder().IPProtocol(Firewall.Rule.IPProtocol.TCP).addPort(port).build();
>  }
> +      public static Rule permitUdpRule(Integer start, Integer end) { return 
> Rule.builder().IPProtocol(Firewall.Rule.IPProtocol.UDP).addPortRange(start, 
> end).build(); }
> +      public static Rule permitUdpRule(Integer port) { return 
> Rule.builder().IPProtocol(Firewall.Rule.IPProtocol.UDP).addPort(port).build();
>  }

Since they construct new instances, I thought to place them close to the top of 
the class (where you might see `public static Thing create(...)` factory 
methods). Any strong feelings about this either way?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/33/files#r7524380

Reply via email to