Class Names

java.lang.Object
io.github.pgatzka.docker.internal.Names

public final class Names extends Object
Pure utility that derives Gradle task names from user-declared spec names. Spec names use [A-Za-z0-9._-]+ characters; each _ / - / . becomes a word boundary in the generated camelCase task name (e.g. postgres_codegenstartPostgresCodegen).
  • Method Details

    • toCamel

      public static String toCamel(String specName)
      Convert a spec name to its camelCase form, treating _, -, and . as word boundaries.
      Parameters:
      specName - the user-declared spec name
      Returns:
      the camelCased form (empty string if the name contains only separators)
      Throws:
      IllegalArgumentException - if specName is null or contains characters outside [A-Za-z0-9._-]
    • startTask

      public static String startTask(String specName)
      Build the start-container task name for a container spec.
      Parameters:
      specName - the container spec name
      Returns:
      the startXxx task name for the container
      Throws:
      IllegalArgumentException - if specName is null or contains illegal chars
    • stopTask

      public static String stopTask(String specName)
      Build the stop-container task name for a container spec.
      Parameters:
      specName - the container spec name
      Returns:
      the stopXxx task name for the container
      Throws:
      IllegalArgumentException - if specName is null or contains illegal chars
    • removeContainerTask

      public static String removeContainerTask(String specName)
      Build the remove-container task name for a container spec.
      Parameters:
      specName - the container spec name
      Returns:
      the removeContainerXxx task name for the container
      Throws:
      IllegalArgumentException - if specName is null or contains illegal chars
    • createVolumeTask

      public static String createVolumeTask(String specName)
      Build the create-volume task name for a volume spec.
      Parameters:
      specName - the volume spec name
      Returns:
      the createVolumeXxx task name for the volume
      Throws:
      IllegalArgumentException - if specName is null or contains illegal chars
    • removeVolumeTask

      public static String removeVolumeTask(String specName)
      Build the remove-volume task name for a volume spec.
      Parameters:
      specName - the volume spec name
      Returns:
      the removeVolumeXxx task name for the volume
      Throws:
      IllegalArgumentException - if specName is null or contains illegal chars
    • createNetworkTask

      public static String createNetworkTask(String specName)
      Build the create-network task name for a network spec.
      Parameters:
      specName - the network spec name
      Returns:
      the createNetworkXxx task name for the network
      Throws:
      IllegalArgumentException - if specName is null or contains illegal chars
    • removeNetworkTask

      public static String removeNetworkTask(String specName)
      Build the remove-network task name for a network spec.
      Parameters:
      specName - the network spec name
      Returns:
      the removeNetworkXxx task name for the network
      Throws:
      IllegalArgumentException - if specName is null or contains illegal chars