@Test public void testToString() { String result = periodDuration1.toString(); assertFalse(periodDuration2.toString().equals(result)); }
@Override public String toString() { StringBuilder s = new StringBuilder(); s.append(DESIGNATOR); if (years != null) { s.append(years).append("Y"); } if (months != null) { s.append(months).append("M"); } if (weeks != null) { s.append(weeks).append("W"); } if (days != null) { s.append(days).append("D"); } if (hours != null || minutes != null || seconds != null) { s.append(TIME_INDICATOR); } if (hours != null) { s.append(hours).append("H"); } if (minutes != null) { s.append(minutes).append("M"); } if (seconds != null) { s.append(seconds).append("S"); } return s.toString(); }
DefaultPeriodDuration extends DefaultDuration implements PeriodDuration { @Override public String toString() { StringBuilder s = new StringBuilder(); s.append(DESIGNATOR); if (years != null) { s.append(years).append("Y"); } if (months != null) { s.append(months).append("M"); } if (weeks != null) { s.append(weeks).append("W"); } if (days != null) { s.append(days).append("D"); } if (hours != null || minutes != null || seconds != null) { s.append(TIME_INDICATOR); } if (hours != null) { s.append(hours).append("H"); } if (minutes != null) { s.append(minutes).append("M"); } if (seconds != null) { s.append(seconds).append("S"); } return s.toString(); } }
DefaultPeriodDuration extends DefaultDuration implements PeriodDuration { @Override public String toString() { StringBuilder s = new StringBuilder(); s.append(DESIGNATOR); if (years != null) { s.append(years).append("Y"); } if (months != null) { s.append(months).append("M"); } if (weeks != null) { s.append(weeks).append("W"); } if (days != null) { s.append(days).append("D"); } if (hours != null || minutes != null || seconds != null) { s.append(TIME_INDICATOR); } if (hours != null) { s.append(hours).append("H"); } if (minutes != null) { s.append(minutes).append("M"); } if (seconds != null) { s.append(seconds).append("S"); } return s.toString(); } DefaultPeriodDuration(InternationalString years, InternationalString months, InternationalString week, InternationalString days,
            InternationalString hours, InternationalString minutes, InternationalString seconds);  DefaultPeriodDuration(long durationInMilliSeconds); }
DefaultPeriodDuration extends DefaultDuration implements PeriodDuration { @Override public String toString() { StringBuilder s = new StringBuilder(); s.append(DESIGNATOR); if (years != null) { s.append(years).append("Y"); } if (months != null) { s.append(months).append("M"); } if (weeks != null) { s.append(weeks).append("W"); } if (days != null) { s.append(days).append("D"); } if (hours != null || minutes != null || seconds != null) { s.append(TIME_INDICATOR); } if (hours != null) { s.append(hours).append("H"); } if (minutes != null) { s.append(minutes).append("M"); } if (seconds != null) { s.append(seconds).append("S"); } return s.toString(); } DefaultPeriodDuration(InternationalString years, InternationalString months, InternationalString week, InternationalString days,
            InternationalString hours, InternationalString minutes, InternationalString seconds);  DefaultPeriodDuration(long durationInMilliSeconds); InternationalString getDesignator(); InternationalString getYears(); InternationalString getMonths(); InternationalString getDays(); InternationalString getTimeIndicator(); InternationalString getHours(); InternationalString getMinutes(); InternationalString getSeconds(); void setYears(InternationalString years); void setMonths(InternationalString months); void setDays(InternationalString days); void setHours(InternationalString hours); void setMinutes(InternationalString minutes); void setSeconds(InternationalString seconds); InternationalString getWeek(); void setWeek(InternationalString week); long getTimeInMillis(); @Override boolean equals(final Object object); @Override int hashCode(); @Override /** * Returns a duration value String in format 8601. the pattern is PnYnMnDTnHnMnS. */ String toString(); }
DefaultPeriodDuration extends DefaultDuration implements PeriodDuration { @Override public String toString() { StringBuilder s = new StringBuilder(); s.append(DESIGNATOR); if (years != null) { s.append(years).append("Y"); } if (months != null) { s.append(months).append("M"); } if (weeks != null) { s.append(weeks).append("W"); } if (days != null) { s.append(days).append("D"); } if (hours != null || minutes != null || seconds != null) { s.append(TIME_INDICATOR); } if (hours != null) { s.append(hours).append("H"); } if (minutes != null) { s.append(minutes).append("M"); } if (seconds != null) { s.append(seconds).append("S"); } return s.toString(); } DefaultPeriodDuration(InternationalString years, InternationalString months, InternationalString week, InternationalString days,
            InternationalString hours, InternationalString minutes, InternationalString seconds);  DefaultPeriodDuration(long durationInMilliSeconds); InternationalString getDesignator(); InternationalString getYears(); InternationalString getMonths(); InternationalString getDays(); InternationalString getTimeIndicator(); InternationalString getHours(); InternationalString getMinutes(); InternationalString getSeconds(); void setYears(InternationalString years); void setMonths(InternationalString months); void setDays(InternationalString days); void setHours(InternationalString hours); void setMinutes(InternationalString minutes); void setSeconds(InternationalString seconds); InternationalString getWeek(); void setWeek(InternationalString week); long getTimeInMillis(); @Override boolean equals(final Object object); @Override int hashCode(); @Override /** * Returns a duration value String in format 8601. the pattern is PnYnMnDTnHnMnS. */ String toString();  }