Class SubprojectName

java.lang.Object
network.ike.workspace.SubprojectName

public final class SubprojectName extends Object
Validated subproject-name value — the workspace.yaml key, the subproject directory name, and the <subproject> reference in aggregator POMs all share this string (ike-issues#295).

Validation matches FeatureName: ASCII letters, digits, -, _, .; must start with a letter or digit. Filesystem-safe and shell-metacharacter-safe by construction.

Single typed entry point so every consumer of a subproject-name argument (ws:add, ws:remove, ws:promote, ws:demote, ws:detach, ws:attach-*, etc.) gets identical validation rather than scattering regex literals at call sites — per the compiler-visibility principle.

  • Method Details

    • of

      public static SubprojectName of(String raw)
      Validate raw and wrap it as a SubprojectName.
      Parameters:
      raw - the candidate name (typically from a -Dsubproject=<name> command-line argument or a workspace.yaml key)
      Returns:
      a validated SubprojectName
      Throws:
      IllegalArgumentException - if raw is null, empty, or violates any documented rule
    • value

      public String value()
      The validated subproject name as a string.
      Returns:
      the raw value (never null or empty)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object