diff options
author | Jon Bratseth <jonbratseth@yahoo.com> | 2017-11-24 10:32:18 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-24 10:32:18 +0100 |
commit | 67dac84dbbabc92340c693039b83e43763b3c4f4 (patch) | |
tree | 5217d054aae3a757f4d5da98544fc636d6457bb6 | |
parent | 27e0d2d28a01b1738641fc25a3cad545194207b8 (diff) | |
parent | 3f16cac6f27845a0dd69a307ca81d0c30ffd6b64 (diff) |
Merge pull request #4269 from vespa-engine/jvenstad/support-issue-types
Add support for type
-rw-r--r-- | controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/Issue.java | 36 |
1 files changed, 27 insertions, 9 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/Issue.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/Issue.java index df182b56fd8..37356f2c2a6 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/Issue.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/Issue.java @@ -19,8 +19,9 @@ public class Issue { private final String label; private final User assignee; private final PropertyId propertyId; + private final Type type; - private Issue(String summary, String description, String label, User assignee, PropertyId propertyId) { + private Issue(String summary, String description, String label, User assignee, PropertyId propertyId, Type type) { if (summary.isEmpty()) throw new IllegalArgumentException("Issue summary can not be empty!"); if (description.isEmpty()) throw new IllegalArgumentException("Issue description can not be empty!"); Objects.requireNonNull(propertyId, "An issue must belong to a property!"); @@ -30,26 +31,31 @@ public class Issue { this.label = label; this.assignee = assignee; this.propertyId = propertyId; + this.type = type; } public Issue(String summary, String description, PropertyId propertyId) { - this(summary, description, null, null, propertyId); + this(summary, description, null, null, propertyId, Type.defect); } public Issue append(String appendage) { - return new Issue(summary, description + appendage, label, assignee, propertyId); + return new Issue(summary, description + appendage, label, assignee, propertyId, type); } - public Issue withLabel(String label) { - return new Issue(summary, description, label, assignee, propertyId); + public Issue with(String label) { + return new Issue(summary, description, label, assignee, propertyId, type); } - public Issue withAssignee(User assignee) { - return new Issue(summary, description, label, assignee, propertyId); + public Issue with(User assignee) { + return new Issue(summary, description, label, assignee, propertyId, type); } - public Issue withPropertyId(PropertyId propertyId) { - return new Issue(summary, description, label, assignee, propertyId); + public Issue with(PropertyId propertyId) { + return new Issue(summary, description, label, assignee, propertyId, type); + } + + public Issue with(Type type) { + return new Issue(summary, description, label, assignee, propertyId, type); } public String summary() { @@ -72,4 +78,16 @@ public class Issue { return propertyId; } + public Type type() { + return type; + } + + + public enum Type { + + defect, // A defect which needs fixing. + task // A task the humans must perform. + + } + } |