@Override public String asString() { switch (specialChar.getValue()) { case NONE: return getTime().toString(); case HASH: return String.format("%s#%s", getTime(), getNth()); case W: return isDefault(getTime()) ? "W" : String.format("%sW", getTime()); case L: return isDefault(getTime()) ? "L" : String.format("%sL", getTime()); default: return specialChar.toString(); } }
public On(IntegerFieldValue time, SpecialCharFieldValue specialChar) { this(time, specialChar, new IntegerFieldValue(-1)); checkArgument( !specialChar.getValue().equals(SpecialChar.HASH), "value missing for a#b cron expression"); }