Class Names
java.lang.Object
io.github.pgatzka.docker.internal.Names
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_codegen →
startPostgresCodegen).-
Method Summary
Modifier and TypeMethodDescriptionstatic StringcreateNetworkTask(String specName) Build the create-network task name for a network spec.static StringcreateVolumeTask(String specName) Build the create-volume task name for a volume spec.static StringremoveContainerTask(String specName) Build the remove-container task name for a container spec.static StringremoveNetworkTask(String specName) Build the remove-network task name for a network spec.static StringremoveVolumeTask(String specName) Build the remove-volume task name for a volume spec.static StringBuild the start-container task name for a container spec.static StringBuild the stop-container task name for a container spec.static StringConvert a spec name to its camelCase form, treating_,-, and.as word boundaries.
-
Method Details
-
toCamel
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- ifspecNameis null or contains characters outside[A-Za-z0-9._-]
-
startTask
Build the start-container task name for a container spec.- Parameters:
specName- the container spec name- Returns:
- the
startXxxtask name for the container - Throws:
IllegalArgumentException- ifspecNameis null or contains illegal chars
-
stopTask
Build the stop-container task name for a container spec.- Parameters:
specName- the container spec name- Returns:
- the
stopXxxtask name for the container - Throws:
IllegalArgumentException- ifspecNameis null or contains illegal chars
-
removeContainerTask
Build the remove-container task name for a container spec.- Parameters:
specName- the container spec name- Returns:
- the
removeContainerXxxtask name for the container - Throws:
IllegalArgumentException- ifspecNameis null or contains illegal chars
-
createVolumeTask
Build the create-volume task name for a volume spec.- Parameters:
specName- the volume spec name- Returns:
- the
createVolumeXxxtask name for the volume - Throws:
IllegalArgumentException- ifspecNameis null or contains illegal chars
-
removeVolumeTask
Build the remove-volume task name for a volume spec.- Parameters:
specName- the volume spec name- Returns:
- the
removeVolumeXxxtask name for the volume - Throws:
IllegalArgumentException- ifspecNameis null or contains illegal chars
-
createNetworkTask
Build the create-network task name for a network spec.- Parameters:
specName- the network spec name- Returns:
- the
createNetworkXxxtask name for the network - Throws:
IllegalArgumentException- ifspecNameis null or contains illegal chars
-
removeNetworkTask
Build the remove-network task name for a network spec.- Parameters:
specName- the network spec name- Returns:
- the
removeNetworkXxxtask name for the network - Throws:
IllegalArgumentException- ifspecNameis null or contains illegal chars
-