public class Ports extends Object
| Modifier and Type | Method and Description |
|---|---|
static com.google.common.collect.ImmutableSet<Port> |
parse(List<String> ports)
Converts/validates a list of strings representing port ranges to an expanded list of
Ports. |
public static com.google.common.collect.ImmutableSet<Port> parse(List<String> ports) throws NumberFormatException
Ports.
For example: ["1000", "2000-2002"] will expand to a list of Ports with the port
numbers [1000, 2000, 2001, 2002]
ports - the list of port numbers/ranges, with an optional protocol separated by a '/'
(defaults to TCP if missing).PortNumberFormatException - if any of the ports are in an invalid format or out of rangeCopyright © 2019. All rights reserved.