Package com.google.cloud.tools.jib.api
Class Ports
- java.lang.Object
-
- com.google.cloud.tools.jib.api.Ports
-
public class Ports extends java.lang.Object
Utility for parsing Docker/OCI ports from text representations.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.Set<com.google.cloud.tools.jib.api.buildplan.Port>
parse(java.util.List<java.lang.String> ports)
Converts/validates a list of strings representing port ranges to an expanded list ofPort
s.
-
-
-
Method Detail
-
parse
public static java.util.Set<com.google.cloud.tools.jib.api.buildplan.Port> parse(java.util.List<java.lang.String> ports) throws java.lang.NumberFormatException
Converts/validates a list of strings representing port ranges to an expanded list ofPort
s.For example: ["1000", "2000-2002"] will expand to a list of
Port
s with the port numbers [1000, 2000, 2001, 2002]- Parameters:
ports
- the list of port numbers/ranges, with an optional protocol separated by a '/' (defaults to TCP if missing).- Returns:
- the ports as a list of
Port
- Throws:
java.lang.NumberFormatException
- if any of the ports are in an invalid format or out of range
-
-