summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Marius Venstad <jvenstad@yahoo-inc.com>2017-11-24 09:02:39 +0100
committerJon Marius Venstad <jvenstad@yahoo-inc.com>2017-11-24 09:02:39 +0100
commit3f16cac6f27845a0dd69a307ca81d0c30ffd6b64 (patch)
treed766856722e75d79e3cbbf116f23f2376d11fcb0
parent098d293e09e7e2fe6b104efb5d89b348549579d9 (diff)
Add support for type
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/organization/Issue.java36
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.
+
+ }
+
}