diff options
Diffstat (limited to 'controller-api')
-rw-r--r-- | controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/SourceRevision.java | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/SourceRevision.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/SourceRevision.java index 47538b4aaca..a9c1155c5ef 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/SourceRevision.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/SourceRevision.java @@ -15,9 +15,12 @@ public class SourceRevision { private final String commit; public SourceRevision(String repository, String branch, String commit) { - this.repository = nonBlank(repository, "repository cannot be null or empty"); - this.branch = nonBlank(branch, "branch cannot be null or empty"); - this.commit = nonBlank(commit, "commit cannot be null"); + Objects.requireNonNull(repository, "repository cannot be null"); + Objects.requireNonNull(branch, "branch cannot be null"); + Objects.requireNonNull(commit, "commit cannot be null"); + this.repository = repository; + this.branch = branch; + this.commit = commit; } public String repository() { return repository; } @@ -42,11 +45,4 @@ public class SourceRevision { public String toString() { return "source revision of repository '" + repository + "', branch '" + branch + "' with commit '" + commit + "'"; } - - private static String nonBlank(String s, String message) { - Objects.requireNonNull(message); - if (s.isBlank()) throw new IllegalArgumentException(message); - return s; - } - } |