@Override public Predicate<ServerWebExchange> apply(Config config) { ZonedDateTime datetime = config.getDatetime(); return exchange -> { final ZonedDateTime now = ZonedDateTime.now(); return now.isAfter(datetime); }; }
@Override public Predicate<ServerWebExchange> apply(Config config) { ZonedDateTime datetime1 = config.datetime1; ZonedDateTime datetime2 = config.datetime2; Assert.isTrue(datetime1.isBefore(datetime2), config.datetime1 + " must be before " + config.datetime2); return exchange -> { final ZonedDateTime now = ZonedDateTime.now(); return now.isAfter(datetime1) && now.isBefore(datetime2); }; }
@Override public ZonedDateTime getNextTriggerTime(ZonedDateTime zonedNow, ZoneId zoneId) { ZonedDateTime zonedStartAt = buildZonedStartAt(zonedNow, zoneId); return zonedStartAt.isAfter(zonedNow) ? zonedStartAt : zonedStartAt.plusDays(1); } }
@Override public ZonedDateTime getNextTriggerTime(ZonedDateTime zonedNow, ZoneId zoneId) { ZonedDateTime zonedStartAt = buildZonedStartAt(zonedNow, zoneId); DayOfWeek dayOfWeek = DayOfWeek.of(dayOfTheWeek); zonedStartAt = zonedStartAt.with(TemporalAdjusters.nextOrSame(dayOfWeek)); return zonedStartAt.isAfter(zonedNow) ? zonedStartAt : zonedStartAt.with(TemporalAdjusters.next(dayOfWeek)); } }
@Override public ZonedDateTime getNextTriggerTime(ZonedDateTime zonedNow, ZoneId zoneId) { ZonedDateTime zonedStartAt = buildZonedStartAt(zonedNow, zoneId); switch (dayOfMonth) { case LAST: zonedStartAt = zonedStartAt.with(TemporalAdjusters.lastDayOfMonth()); return zonedStartAt.isAfter(zonedNow) ? zonedStartAt : zonedStartAt.plusDays(1).with(TemporalAdjusters.lastDayOfMonth()); case FIRST: default: zonedStartAt = zonedStartAt.with(TemporalAdjusters.firstDayOfMonth()); return zonedStartAt.isAfter(zonedNow) ? zonedStartAt : zonedStartAt.with(TemporalAdjusters.firstDayOfNextMonth()); } } }
/** * Verifies that the actual {@code ZonedDateTime} is <b>strictly</b> after the given one. * <p> * Comparison is done on {@code ZonedDateTime}'s instant (i.e. {@link ZonedDateTime#toEpochSecond()}) * <p> * Example : * <pre><code class='java'> assertThat(parse("2000-01-01T00:00:00Z")).isAfter(parse("1999-12-31T23:59:59Z"));</code></pre> * * @param other the given {@link ZonedDateTime}. * @return this assertion object. * @throws AssertionError if the actual {@code ZonedDateTime} is {@code null}. * @throws IllegalArgumentException if other {@code ZonedDateTime} is {@code null}. * @throws AssertionError if the actual {@code ZonedDateTime} is not strictly after the given one. */ public SELF isAfter(ZonedDateTime other) { Objects.instance().assertNotNull(info, actual); assertDateTimeParameterIsNotNull(other); if (!actual.isAfter(other)) { throw Failures.instance().failure(info, shouldBeAfter(actual, other)); } return myself; }
/** * Verifies that the actual {@code ZonedDateTime} is before or equals to the given one. * <p> * Comparison is done on {@code ZonedDateTime}'s instant (i.e. {@link ZonedDateTime#toEpochSecond()}) * <p> * Example : * <pre><code class='java'> assertThat(parse("2000-01-01T23:59:59Z")).isBeforeOrEqualTo(parse("2000-01-01T23:59:59Z")) * .isBeforeOrEqualTo(parse("2000-01-02T00:00:00Z"));</code></pre> * * @param other the given {@link ZonedDateTime}. * @return this assertion object. * @throws AssertionError if the actual {@code ZonedDateTime} is {@code null}. * @throws IllegalArgumentException if other {@code ZonedDateTime} is {@code null}. * @throws AssertionError if the actual {@code ZoneDateTime} is not before or equals to the given one. */ public SELF isBeforeOrEqualTo(ZonedDateTime other) { Objects.instance().assertNotNull(info, actual); assertDateTimeParameterIsNotNull(other); if (actual.isAfter(other)) { throw Failures.instance().failure(info, shouldBeBeforeOrEqualsTo(actual, other)); } return myself; }
private ZonedDateTime adjustToStartDate(ZonedDateTime zonedStartAt, ZonedDateTime zonedNow, ZoneId zoneId) { if (durationType == ReportDurationType.CUSTOM) { ZonedDateTime zonedStartDate = getZonedFromTs(startTs, zoneId).with(LocalTime.MIN); if (zonedStartDate.isAfter(zonedNow)) { zonedStartAt = zonedStartAt .withDayOfMonth(zonedStartDate.getDayOfMonth()) .withMonth(zonedStartDate.getMonthValue()) .withYear(zonedStartDate.getYear()); } } return zonedStartAt; }
/** * Verifies that the actual {@code ZonedDateTime} is <b>strictly</b> after the given one. * <p> * Comparison is done on {@code ZonedDateTime}'s instant (i.e. {@link ZonedDateTime#toEpochSecond()}) * <p> * Example : * <pre><code class='java'> assertThat(parse("2000-01-01T00:00:00Z")).isAfter(parse("1999-12-31T23:59:59Z"));</code></pre> * * @param other the given {@link ZonedDateTime}. * @return this assertion object. * @throws AssertionError if the actual {@code ZonedDateTime} is {@code null}. * @throws IllegalArgumentException if other {@code ZonedDateTime} is {@code null}. * @throws AssertionError if the actual {@code ZonedDateTime} is not strictly after the given one. */ public SELF isAfter(ZonedDateTime other) { Objects.instance().assertNotNull(info, actual); assertDateTimeParameterIsNotNull(other); if (!actual.isAfter(other)) { throw Failures.instance().failure(info, shouldBeAfter(actual, other)); } return myself; }
/** * Verifies that the actual {@code ZonedDateTime} is before or equals to the given one. * <p> * Comparison is done on {@code ZonedDateTime}'s instant (i.e. {@link ZonedDateTime#toEpochSecond()}) * <p> * Example : * <pre><code class='java'> assertThat(parse("2000-01-01T23:59:59Z")).isBeforeOrEqualTo(parse("2000-01-01T23:59:59Z")) * .isBeforeOrEqualTo(parse("2000-01-02T00:00:00Z"));</code></pre> * * @param other the given {@link ZonedDateTime}. * @return this assertion object. * @throws AssertionError if the actual {@code ZonedDateTime} is {@code null}. * @throws IllegalArgumentException if other {@code ZonedDateTime} is {@code null}. * @throws AssertionError if the actual {@code ZoneDateTime} is not before or equals to the given one. */ public SELF isBeforeOrEqualTo(ZonedDateTime other) { Objects.instance().assertNotNull(info, actual); assertDateTimeParameterIsNotNull(other); if (actual.isAfter(other)) { throw Failures.instance().failure(info, shouldBeBeforeOrEqualsTo(actual, other)); } return myself; }
@Override protected void checkValues() { if (min.isAfter(max)) { throw new IllegalArgumentException("max must be after min"); } }
public boolean isAfter(JodaCompatibleZonedDateTime o) { return dt.isAfter(o.getZonedDateTime()); }
@Override public State calculate(Set<Item> items) { if (items != null && items.size() > 0) { ZonedDateTime max = null; for (Item item : items) { DateTimeType itemState = item.getStateAs(DateTimeType.class); if (itemState != null) { if (max == null || max.isAfter(itemState.getZonedDateTime())) { max = itemState.getZonedDateTime(); } } } if (max != null) { return new DateTimeType(max); } } return UnDefType.UNDEF; }
if(inputDateWithCurrentYear.isAfter(currentDate.plusDays(4L))) { ZonedDateTime inputDateWithPreviousYear = ZonedDateTime.of(currentYear-1, inputMonth, inputDay, inputHour, inputMinute, inputSecond, 0, deviceTimeZone);
/** * if the last token has no expire time it true * @return */ private boolean lastTokenIsStillValid() { if (currentTokensOption.isPresent()) { final Tokens oldTokens = currentTokensOption.get(); return Optional.ofNullable(oldTokens.getExpiresZonedDateTime()).map(expireTime -> expireTime.isAfter(ZonedDateTime.now())).orElse(true); } else { return false; } }
@Override public DoubleArray apply(DoubleArray x) { SabrParametersIborCapletFloorletVolatilities volsNew = updateParameters(volatilities, nExpiries, timeIndex, betaFixed, x); return DoubleArray.of(nCaplets, n -> capList.get(currentStart + n).getCapletFloorletPeriods().stream() .filter(p -> p.getFixingDateTime().isAfter(prevExpiry)) .mapToDouble(p -> sabrPeriodPricer.presentValue(p, ratesProvider, volsNew).getAmount()) .sum() / priceList.get(currentStart + n)); } };
/** * Determines whether the given CRL is expired by comparing the nextUpdate field * with a given date. * * @param crl CRL to examine. * @param reference Reference date for comparison. * @return True if reference date is after CRL next update, false otherwise. */ public static boolean isExpired(final X509CRL crl, final ZonedDateTime reference) { return reference.isAfter(DateTimeUtils.zonedDateTimeOf(crl.getNextUpdate())); }
@Override public Collection<? extends CasEvent> getEventsOfTypeForPrincipal(final String type, final String principal, final ZonedDateTime dateTime) { return getEventsOfTypeForPrincipal(type, principal) .stream() .filter(e -> e.getCreationZonedDateTime().isEqual(dateTime) || e.getCreationZonedDateTime().isAfter(dateTime)) .collect(Collectors.toSet()); }
@Override public Collection<? extends CasEvent> load(final ZonedDateTime dateTime) { return load().stream() .filter(e -> e.getCreationZonedDateTime().isEqual(dateTime) || e.getCreationZonedDateTime().isAfter(dateTime)) .collect(Collectors.toSet()); }
private double priceFixed( ResolvedIborCapFloorLeg cap, RatesProvider ratesProvider, IborCapletFloorletVolatilities vols, ZonedDateTime prevExpiry) { VolatilityIborCapletFloorletPeriodPricer periodPricer = getLegPricer().getPeriodPricer(); return cap.getCapletFloorletPeriods().stream() .filter(p -> !p.getFixingDateTime().isAfter(prevExpiry)) .mapToDouble(p -> periodPricer.presentValue(p, ratesProvider, vols).getAmount()) .sum(); }