示例#1
0
 /**
  * Resolves singletons.
  *
  * @return the singleton instance
  */
 private Object readResolve() {
   return Months.of(months);
 }
示例#2
0
 /**
  * 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);
 }