Tenor implements Comparable<Tenor>, Serializable { @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("Tenor["); if (_period == null) { sb.append(getBusinessDayTenor().toString()); } else { sb.append(getPeriod().toString()); } sb.append("]"); return sb.toString(); } @Deprecated  Tenor(final Period period); private  Tenor(final BusinessDayTenor businessDayTenor); static Tenor of(final Period period); static Tenor of(final BusinessDayTenor businessDayTenor); @FromString @SuppressWarnings("deprecation") static Tenor parse(final String tenorStr); Period getPeriod(); BusinessDayTenor getBusinessDayTenor(); boolean isBusinessDayTenor(); static final Tenor ofDays(final int days); static final Tenor ofWeeks(final int weeks); static final Tenor ofMonths(final int months); static final Tenor ofYears(final int years); static final Tenor ofBusinessDay(final BusinessDayTenor businessDayTenor); static final Tenor ofBusinessDay(final String businessDayTenor); @ToString String toFormattedString(); @Override int compareTo(final Tenor other); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString(); @Deprecated
  static final Tenor OVERNIGHT; static final Tenor DAY; static final Tenor ONE_DAY; static final Tenor TWO_DAYS; static final Tenor THREE_DAYS; static final Tenor ONE_WEEK; static final Tenor TWO_WEEKS; static final Tenor THREE_WEEKS; static final Tenor SIX_WEEKS; static final Tenor ONE_MONTH; static final Tenor TWO_MONTHS; static final Tenor THREE_MONTHS; static final Tenor FOUR_MONTHS; static final Tenor FIVE_MONTHS; static final Tenor SIX_MONTHS; static final Tenor SEVEN_MONTHS; static final Tenor EIGHT_MONTHS; static final Tenor NINE_MONTHS; static final Tenor TEN_MONTHS; static final Tenor ELEVEN_MONTHS; static final Tenor TWELVE_MONTHS; static final Tenor EIGHTEEN_MONTHS; static final Tenor ONE_YEAR; static final Tenor TWO_YEARS; static final Tenor THREE_YEARS; static final Tenor FOUR_YEARS; static final Tenor FIVE_YEARS; static final Tenor SIX_YEARS; static final Tenor SEVEN_YEARS; static final Tenor EIGHT_YEARS; static final Tenor NINE_YEARS; static final Tenor TEN_YEARS; static final Tenor WORKING_WEEK; static final Tenor YEAR; static final Tenor LEAP_YEAR; static final Tenor ON; static final Tenor SN; static final Tenor TN; }
@Test public void testToString() { Tenor tenor = Tenor.FOUR_MONTHS; assertEquals("Tenor[P4M]", tenor.toString()); tenor = Tenor.FOUR_YEARS; assertEquals("Tenor[P4Y]", tenor.toString()); tenor = Tenor.ON; assertEquals("Tenor[OVERNIGHT]", tenor.toString()); tenor = Tenor.SN; assertEquals("Tenor[SPOT_NEXT]", tenor.toString()); }