Tenor implements Comparable<Tenor>, Serializable { public BusinessDayTenor getBusinessDayTenor() { if (_businessDayTenor == null) { throw new IllegalStateException("Could not get business day tenor for " + toString()); } return _businessDayTenor; } @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(expectedExceptions = IllegalStateException.class) public void testGetBusinessDays() { assertEquals(BusinessDayTenor.OVERNIGHT, Tenor.ON.getBusinessDayTenor()); assertEquals(BusinessDayTenor.SPOT_NEXT, Tenor.SN.getBusinessDayTenor()); assertEquals(BusinessDayTenor.TOM_NEXT, Tenor.TN.getBusinessDayTenor()); Tenor.DAY.getBusinessDayTenor(); }