Class GitLabRepoUrl
java.lang.Object
studentrepoloader.model.GitLabRepoUrl
Value object representing a cleaned and validated GitLab repository URL,
with full traceability of all applied sanitation steps.
This object is used by default in the GitLabSubmissionFields
interface to normalize raw student input into a usable HTTPS clone URL.
It provides immutable access to:
- The final cleaned URL (typically HTTPS + .git suffix)
- A list of
GitLabRepoUrl.CleaningStep
values that describe each transformation
CleaningStep
. Each transformation method is exposed for unit testing.
Typical usage:
for (DefaultGitLabSubmission s : submissions) {
GitLabRepoUrl repo = s.getRepoUrl();
System.out.println("Clean URL: " + repo.url());
System.out.println("Steps: " + repo.steps());
}
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Enum describing every possible cleaning transformation that may be applied during sanitation. -
Method Summary
Modifier and TypeMethodDescriptionstatic GitLabRepoUrl
Parses and sanitizes a raw input string using the expected GitLab prefix.steps()
Returns an immutable list of cleaning operations that were applied.toString()
url()
Returns the sanitized URL string, typically HTTPS and ending with.git
.
-
Method Details
-
parse
Parses and sanitizes a raw input string using the expected GitLab prefix.Applies multiple cleaning operations in sequence, tracking each applied transformation via
GitLabRepoUrl.CleaningStep
.- Parameters:
raw
- raw input string from CSVexpectedPrefix
- required host prefix (e.g."https://gitlab.utu.fi/"
)- Returns:
- a fully cleaned
GitLabRepoUrl
with transformation log
-
url
Returns the sanitized URL string, typically HTTPS and ending with.git
. -
steps
Returns an immutable list of cleaning operations that were applied. This can be used for auditing, diagnostics, or rule-based filtering. -
toString
-