@Override public boolean hasNext() { return !startDate.isAfter(endDate); }
@Override public boolean hasNext() { return !startDate.isAfter(endDate); }
public boolean expired() { return new LocalDateTime().isAfter(expirationDate); }
@Override public void handle(String s) { String[] split = StringUtils.split(s, '\t'); if(split != null && split.length >= 3) { if(split[0].equals(itg.id)) { LocalDateTime t = new LocalDateTime(StringUtils.removeEnd(split[1], "Z")); if(itg.timestamp == null || t.isAfter(itg.timestamp)) { itg.geometry = split[2]; itg.timestamp = t; } } else { if(itg.id != null) { tmpW.println(itg.id + '\t' + itg.timestamp.toString() + '\t' + itg.geometry); } itg.id = split[0]; itg.geometry = split[2]; itg.timestamp = LocalDateTime.parse(split[1]); } } }
@Override public WorkflowId findLatestWorkflowIdBySource(String workflowName) { if (workflowName==null) { return null; } ExecutableWorkflow latestWorkflow = null; LocalDateTime latestDeployTime = null; for (ExecutableWorkflow workflow: workflows.values()) { if ( workflowName.equals(workflow.getSourceWorkflowId()) && (latestDeployTime==null || latestDeployTime.isAfter(workflow.getCreateTime())) ) { latestWorkflow = workflow; latestDeployTime = workflow.getCreateTime(); } } return latestWorkflow!=null ? latestWorkflow.getId() : null; }
@Override public LocalDateTime resolve(LocalDateTime base) { LocalDateTime time = null; if (HOUR_OF_DAY.equals(indexUnit)) { time = base.withTime(index, 0, 0, 0); if (!time.isAfter(base)) { return time.plusDays(1); } } else if (DAY_OF_WEEK.equals(indexUnit)) { time = base .withDayOfWeek(index) .withTime(0, 0, 0, 0); if (!time.isAfter(base)) { time = time.plusWeeks(1); } } else if (DAY_OF_MONTH.equals(indexUnit)) { time = base .withDayOfMonth(index) .withTime(0, 0, 0, 0); if (!time.isAfter(base)) { time = time.plusMonths(1); } } if (atHour!=null) { time = time.withTime(atHour, atMinute!=null ? atMinute : 0, 0, 0); } return time; }
@Override public LocalDateTime resolve(LocalDateTime base) { LocalDateTime time = null; if (HOUR_OF_DAY.equals(indexUnit)) { time = base.withTime(index, 0, 0, 0); if (!time.isAfter(base)) { return time.plusDays(1); } } else if (DAY_OF_WEEK.equals(indexUnit)) { time = base .withDayOfWeek(index) .withTime(0, 0, 0, 0); if (!time.isAfter(base)) { time = time.plusWeeks(1); } } else if (DAY_OF_MONTH.equals(indexUnit)) { time = base .withDayOfMonth(index) .withTime(0, 0, 0, 0); if (!time.isAfter(base)) { time = time.plusMonths(1); } } if (atHour!=null) { time = time.withTime(atHour, atMinute!=null ? atMinute : 0, 0, 0); } return time; }
@Override protected boolean isCoherent() { if ((hasMinComplete()) && (hasMaxComplete()) && (getMin().isAfter(getMax()))) { return false; } return true; }
@Override protected boolean isCoherent() { if ((hasMinComplete()) && (hasMaxComplete()) && (getMin().isAfter(getMax()))) { return false; } return true; }
ApexLogHelper.getNiceRate(startEvent.getProgress().getAsLong(), seconds, TimeUnit.SECONDS); if (activeSince.isAfter(oldBarrier)) { LOGGER.trace(LOG_MESSAGE_PROGRESS, activeSince, rate, time, cleanKey); } else if (activeSince.isBefore(muchtooOldBarrier)) { if (activeSince.isAfter(oldBarrier)) { LOGGER.trace(LOG_MESSAGE, activeSince, time, cleanKey); } else if (activeSince.isBefore(muchtooOldBarrier)) {
@Override public int compare(WebHookHistoryItem o1, WebHookHistoryItem o2) { if (sortDirection == SortDirection.DESC) { if (o1.getTimestamp().isBefore(o2.getTimestamp())){ return 1; } else if (o1.getTimestamp().isAfter(o2.getTimestamp())){ return -1; } else { return 0; } } else { if (o1.getTimestamp().isAfter(o2.getTimestamp())){ return 1; } else if (o1.getTimestamp().isBefore(o2.getTimestamp())){ return -1; } else { return 0; } } } }
} else if (now.isAfter(end)) { percentage = Optional.of(100f); } else {
display.append(startDateString); display.append(" - "); String endDateString = weekEnd.minusDays(1).isAfter(endDate) ? endDate.toString(TkConstants.DT_ABBREV_DATE_FORMAT) : weekEnd.minusDays(1).toString(TkConstants.DT_ABBREV_DATE_FORMAT); display.append(endDateString); display.append(startDateString); display.append(" - "); String endDateString = actualEndDate.isAfter(endDate) ? endDate.toString(TkConstants.DT_ABBREV_DATE_FORMAT) : actualEndDate.toString(TkConstants.DT_ABBREV_DATE_FORMAT); display.append(endDateString);
/** * Verifies that the actual {@code LocalDateTime} is before or equals to the given one. * <p> * Example : * <pre><code class='java'> assertThat(new LocalDateTime("2000-01-01")).isBeforeOrEqualTo(new LocalDateTime("2000-01-01")) * .isBeforeOrEqualTo(new LocalDateTime("2000-01-02"));</code></pre> * * @param other the given {@link LocalDateTime}. * @return this assertion object. * @throws AssertionError if the actual {@code LocalDateTime} is {@code null}. * @throws IllegalArgumentException if other {@code LocalDateTime} is {@code null}. * @throws AssertionError if the actual {@code LocalDateTime} is not before or equals to the given one. */ public LocalDateTimeAssert isBeforeOrEqualTo(LocalDateTime other) { Objects.instance().assertNotNull(info, actual); assertLocalDateTimeParameterIsNotNull(other); if (actual.isAfter(other)) { throw Failures.instance().failure(info, shouldBeBeforeOrEqualsTo(actual, other)); } return this; }
/** * Verifies that the actual {@code LocalDateTime} is <b>strictly</b> after the given one. * <p> * Example : * <pre><code class='java'> assertThat(new LocalDateTime("2000-01-01")).isAfter(new LocalDateTime("1999-12-31"));</code></pre> * * @param other the given {@link LocalDateTime}. * @return this assertion object. * @throws AssertionError if the actual {@code LocalDateTime} is {@code null}. * @throws IllegalArgumentException if other {@code LocalDateTime} is {@code null}. * @throws AssertionError if the actual {@code LocalDateTime} is not strictly after the given one. */ public LocalDateTimeAssert isAfter(LocalDateTime other) { Objects.instance().assertNotNull(info, actual); assertLocalDateTimeParameterIsNotNull(other); if (!actual.isAfter(other)) { throw Failures.instance().failure(info, shouldBeAfter(actual, other)); } return this; }
private boolean matches(HistoKey k, Map<String, Object> map, QueryParams query) { if (query.getHorizon() != null && !query.getHorizon().equals(k.getHorizon())) { return false; } if (query.getDayTimeFrom() != null && query.getDayTimeTo() != null) { LocalDateTime check = new DateTime(k.getDateTime()).toLocalDateTime(); LocalDateTime from = new DateTime(query.getDayTimeFrom()).toLocalDateTime(); LocalDateTime to = new DateTime(query.getDayTimeTo()).toLocalDateTime(); LocalDateTime start = new DateTime(k.getDateTime()).toLocalDateTime().withHourOfDay(from.getHourOfDay()) .withMinuteOfHour(from.getMinuteOfHour()).withSecondOfMinute(from.getSecondOfMinute()); LocalDateTime end = new DateTime(k.getDateTime()).toLocalDateTime().withHourOfDay(to.getHourOfDay()) .withMinuteOfHour(to.getMinuteOfHour()).withSecondOfMinute(to.getSecondOfMinute()); if (check.isAfter(end) || check.isBefore(start)) { return false; } } if (query.getForecastTime() >= 0) { if (k.getForecastDistance() != query.getForecastTime()) { return false; } } return true; }