/** * Resolves singletons. * * @return the singleton instance */ private Object readResolve() { return Months.of(months); }
/** * Returns a new instance of the subclass with a different number of months. * * @param amount the number of months to set in the new instance, may be negative * @return a new period element, not null */ @Override public Months withAmount(int amount) { return Months.of(amount); }