Class FeatureName
<feature> portion of a
branch name like feature/<feature> and the suffix portion
of a sibling-clone directory name like
<workspace>-<feature> (ike-issues#201, ike-issues#205).
Centralizes the regex enforcing "filesystem-safe" so the compiler can police a single typed entry point rather than scattered string templates at call sites (per the compiler-visibility principle).
Validation rules — syntactic only:
- Non-empty
- No path separators (
/,\) - No whitespace
- No shell-metacharacter hazards
(
*,?,[,],",',$, backtick) - ASCII letters, digits,
-,_,.; must start with a letter or digit
Uniqueness checks (does a sibling directory already exist?) are intentionally not in this class — those depend on the caller's filesystem context and live in the calling Mojo.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringSeparator between the primary workspace name and the feature in a sibling directory name: U+A789 MODIFIER LETTER COLON (꞉), not a hyphen. -
Method Summary
Modifier and TypeMethodDescriptionbooleaninthashCode()static FeatureNameValidaterawand wrap it as aFeatureName.siblingDirectoryName(String primaryWorkspaceName) Compose the sibling-clone directory name for this feature inside the given primary workspace.toString()value()The validated feature name as a string.
-
Field Details
-
SIBLING_SEPARATOR
Separator between the primary workspace name and the feature in a sibling directory name: U+A789 MODIFIER LETTER COLON (꞉), not a hyphen. A hyphen makes the suffix ambiguous against a hyphenated artifactId (ike-komet-wsr-installer-logs— is the baseike-komet-wsrorike-komet-wsr-installer?);꞉is an unambiguous boundary that never appears in an artifactId and renders as a colon-like glyph. It is filesystem-safe — it is not the reserved ASCII colon U+003A — and, having no NFC/NFD decomposition, it sidesteps the Syncthing cross-machine normalization hazard. Verified across APFS, git, Maven, and a live IntelliJ import (ike-issues#779).- See Also:
-
-
Method Details
-
of
Validaterawand wrap it as aFeatureName.- Parameters:
raw- the candidate feature name (typically from a-Dfeature=<name>command-line argument)- Returns:
- a validated
FeatureName - Throws:
IllegalArgumentException- ifrawis null, empty, or violates any documented rule
-
value
The validated feature name as a string.- Returns:
- the raw value (never null or empty)
-
siblingDirectoryName
Compose the sibling-clone directory name for this feature inside the given primary workspace.For
primaryWorkspaceName="ike-komet-wsr"and feature"reasoner", returns"ike-komet-wsr꞉reasoner"— the primary name and feature joined bySIBLING_SEPARATOR(꞉, U+A789), not a hyphen, so the feature suffix is unambiguous against a hyphenated artifactId.This is the single approved place to construct sibling directory names — call sites must not concatenate strings directly (ike-issues#205).
- Parameters:
primaryWorkspaceName- the primary workspace's directory name; must be non-null and non-empty- Returns:
primaryWorkspaceName + SIBLING_SEPARATOR + value()- Throws:
IllegalArgumentException- ifprimaryWorkspaceNameis null or empty
-
equals
-
hashCode
-
toString
-