public String evaluate(String text, Long date) {
return evaluate(text, date, true);
}
public String evaluate(String text, Long date, Boolean value) {
DayBits daybits;
if (text == null || text.isEmpty()) {
if (date == null || value == null || !value) {
return null;
}
daybits = new DayBits();
} else {
daybits = DayBitsUtils.parse(text);
}
boolean changed = daybits.set(date.intValue(), value);
if (!changed) {
return text;
}
return daybits.toString();
}