18 package org.turro.dossier.entity;
20 import java.util.ArrayList;
21 import java.util.List;
22 import org.turro.i18n.I_;
23 import org.zkoss.lang.Objects;
41 private final boolean seen, working, standBy,
finished;
43 private IssueStatus(
boolean seen,
boolean working,
boolean standBy,
boolean finished) {
45 this.working = working;
46 this.standBy = standBy;
47 this.finished = finished;
67 return switch (
this) {
68 case STATUS_NEW ->
"olive";
69 case STATUS_INCOMPLETE ->
"orange";
70 case STATUS_STARTED ->
"yellow";
71 case STATUS_REOPENED ->
"yellow";
72 case STATUS_REUNION ->
"brown";
73 case STATUS_FROZEN ->
"grey";
74 case STATUS_RESOLVED, STATUS_VERIFIED, STATUS_CLOSED ->
switch(resolution) {
75 case RESOLUTION_NONE ->
"olive";
76 case RESOLUTION_FIXED ->
"green";
77 case RESOLUTION_WORKSFORME ->
"yellow";
78 case RESOLUTION_DUPLICATED, RESOLUTION_MOVED ->
"teal";
79 case RESOLUTION_WONTFIX, RESOLUTION_INVALID ->
"red";
87 return I_.
byKey(this.toString()) + (!this.isFinished() ?
"" :
88 (
" - " +
I_.
byKey(resolution.toString())));
93 public static List<IssueStatus>
selectBy(Boolean seen, Boolean working, Boolean standBy, Boolean finished) {
94 List<IssueStatus> list=
new ArrayList<>();
96 if((seen ==
null || Objects.equals(status.isSeen(), seen)) &&
97 (working ==
null || Objects.equals(status.isWorking(), working)) &&
98 (standBy ==
null || Objects.equals(status.isStandBy(), standBy)) &&
99 (finished ==
null || Objects.equals(status.isFinished(), finished))) {
static String byKey(String key)
String label(IssueResolution resolution)
String color(IssueResolution resolution)
static List< IssueStatus > selectBy(Boolean seen, Boolean working, Boolean standBy, Boolean finished)