/** * Gets the period type, which is <code>hours</code>. * * @return the period type */ public PeriodType getPeriodType() { return PeriodType.hours(); }
/** * Gets the period type, which is <code>hours</code>. * * @return the period type */ public PeriodType getPeriodType() { return PeriodType.hours(); }
/** * Gets the period type, which is <code>hours</code>. * * @return the period type */ public PeriodType getPeriodType() { return PeriodType.hours(); }
/** * Gets the period type, which is <code>hours</code>. * * @return the period type */ public PeriodType getPeriodType() { return PeriodType.hours(); }
/** * Gets the period type, which is <code>hours</code>. * * @return the period type */ public PeriodType getPeriodType() { return PeriodType.hours(); }
/** * Gets the period type, which is <code>hours</code>. * * @return the period type */ public PeriodType getPeriodType() { return PeriodType.hours(); }
/** * Gets the period type, which is <code>hours</code>. * * @return the period type */ public PeriodType getPeriodType() { return PeriodType.hours(); }
/** * Gets the period type, which is <code>hours</code>. * * @return the period type */ public PeriodType getPeriodType() { return PeriodType.hours(); }
/** * Gets the period type, which is <code>hours</code>. * * @return the period type */ public PeriodType getPeriodType() { return PeriodType.hours(); }
/** * Gets the period type, which is <code>hours</code>. * * @return the period type */ public PeriodType getPeriodType() { return PeriodType.hours(); }
/** * Gets the period type, which is <code>hours</code>. * * @return the period type */ public PeriodType getPeriodType() { return PeriodType.hours(); }
private static PeriodType getPeriodType(OrgInterval.Unit unit) { switch (unit) { case HOUR: return PeriodType.hours(); case DAY: return PeriodType.days(); case WEEK: return PeriodType.weeks(); case MONTH: return PeriodType.months(); case YEAR: return PeriodType.years(); default: throw new IllegalArgumentException("Unknown unit " + unit); } }
@Override int getDuration(DateTime now, DateTime expiryDate) { Interval interval = new Interval(now.withSecondOfMinute(0).withMillisOfSecond(0), expiryDate); return interval.toPeriod(PeriodType.hours()).getHours(); }
@Override int getDuration(DateTime now, DateTime expiryDate) { Interval interval = new Interval(now.withSecondOfMinute(0).withMillisOfSecond(0), expiryDate); return interval.toPeriod(PeriodType.hours()).getHours(); }
@Override public Period random() { return new Period(RandomData.randomLong(0, 1000), RandomData.random( Arrays.asList( PeriodType.millis(), PeriodType.seconds(), PeriodType.minutes(), PeriodType.hours(), PeriodType.days(), PeriodType.weeks(), PeriodType.months(), PeriodType.years() ))); }
public FactoryCache getFactoryCache() { FactoryCache cache = new FactoryCache(); cache.put( Chronology.class, values(GregorianChronology.getInstanceUTC(), ISOChronology.getInstanceUTC(), GregorianChronology.getInstanceUTC())); cache.put( DateTimeZone.class, values(DateTimeZone.forOffsetHours(+1), DateTimeZone.forOffsetHours(-10), DateTimeZone.forOffsetHours(+1))); cache.put( PeriodType.class, values(PeriodType.days(), PeriodType.hours(), PeriodType.days())); cache.put( YearMonth.class, values(new YearMonth(2018, 5), new YearMonth(2014, 7), new YearMonth(2018, 5))); cache.put( MonthDay.class, values(new MonthDay(6, 1), new MonthDay(6, 26), new MonthDay(6, 1))); return cache; } }
public FactoryCache getFactoryCache() { FactoryCache cache = new FactoryCache(); cache.put( Chronology.class, values(GregorianChronology.getInstanceUTC(), ISOChronology.getInstanceUTC(), GregorianChronology.getInstanceUTC())); cache.put( DateTimeZone.class, values(DateTimeZone.forOffsetHours(+1), DateTimeZone.forOffsetHours(-10), DateTimeZone.forOffsetHours(+1))); cache.put( PeriodType.class, values(PeriodType.days(), PeriodType.hours(), PeriodType.days())); cache.put( YearMonth.class, values(new YearMonth(2018, 5), new YearMonth(2014, 7), new YearMonth(2018, 5))); cache.put( MonthDay.class, values(new MonthDay(6, 1), new MonthDay(6, 26), new MonthDay(6, 1))); return cache; } }