Class 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 of Ports.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 of Ports.

        For example: ["1000", "2000-2002"] will expand to a list of Ports 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