@Override public boolean equals( Value other ) { return other instanceof DateValue && value.equals( ((DateValue) other).value ); }
private DateCell findDayCellOfDate(LocalDate date) { for (int i = 0; i < dayCellDates.length; i++) { if (date.equals(dayCellDates[i])) { return dayCells.get(i); } } return dayCells.get(dayCells.size() / 2 + 1); }
@Override public boolean equals(Object other) { if (! (other instanceof Validity)) return false; Validity v = (Validity) other; return validity.equals(v.validity) && zoneId.equals(v.zoneId) && start.equals(v.start); }
public boolean isOnSameDayAs(Timeslot other) { return startDateTime.toLocalDate().equals(other.getStartDateTime().toLocalDate()); }
private void writeDaysSheets() { List<LocalDate> dayList = solution.getTimeslotList().stream().map(Timeslot::getDate).distinct().collect(toList()); for (LocalDate day : dayList) { List<Timeslot> dayTimeslotList = solution.getTimeslotList().stream().filter(timeslot -> timeslot.getDate().equals(day)).collect(toList()); List<Talk> dayTalkList = solution.getTalkList().stream().filter(talk -> talk.getTimeslot() != null && talk.getTimeslot().getDate().equals(day)).collect(toList()); writeDaySheet(day, dayTimeslotList, dayTalkList); } }
/** * {@inheritDoc} */ @Override public Map<Currency, BigDecimal> getCurrentRates() { if (container == null || !container.getDate().equals(LocalDate.now())) { container = client.getRates(Currency.getBase()); log.info("exchange rates has been updated: {}", container); } return ImmutableMap.of( Currency.EUR, container.getRates().get(Currency.EUR.name()), Currency.RUB, container.getRates().get(Currency.RUB.name()), Currency.USD, BigDecimal.ONE ); }
private boolean maybeRolloverWriterForDay() throws IOException { if (writer == null || !logger.getNow().toLocalDate().equals(writerDate)) { if (writer != null) { // Day change over case, reset the logFileCount. logFileCount = 0; IOUtils.closeQuietly(writer); writer = null; } // increment log file count, if creating a new writer. writer = logger.getWriter(logFileName + "_" + ++logFileCount); writerDate = logger.getDateFromDir(writer.getPath().getParent().getName()); return true; } return false; }
private void readTimeslotDaysHeaders() { LocalDate previousTimeslotDay = null; for (Timeslot timeslot : solution.getTimeslotList()) { LocalDate timeslotDay = timeslot.getDate(); if (timeslotDay.equals(previousTimeslotDay)) { readHeaderCell(""); } else { readHeaderCell(DAY_FORMATTER.format(timeslotDay)); previousTimeslotDay = timeslotDay; } } }
private Map<Integer, List<FlightAssignment>> extractHourToAssignmentListMap( List<FlightAssignment> employeeAssignmentList, LocalDate date) { Map<Integer, List<FlightAssignment>> hourToAssignmentListMap = new HashMap<>( employeeAssignmentList.size()); int previousArrivalHour = -1; List<FlightAssignment> previousFlightAssignmentList = null; for (FlightAssignment flightAssignment : employeeAssignmentList) { Flight flight = flightAssignment.getFlight(); if (flight.getDepartureUTCDate().equals(date)) { int departureHour = flight.getDepartureUTCTime().getHour(); int arrivalHour = flight.getArrivalUTCTime().getHour(); if (previousArrivalHour < departureHour) { previousFlightAssignmentList = new ArrayList<>(24); hourToAssignmentListMap.put(departureHour, previousFlightAssignmentList); previousArrivalHour = arrivalHour; } else { previousArrivalHour = Math.max(previousArrivalHour, arrivalHour); } previousFlightAssignmentList.add(flightAssignment); } } return hourToAssignmentListMap; }
.filter(timeslot -> !timeslot.getDate().equals(availableDate)) .collect(Collectors.toCollection(LinkedHashSet::new)); } else {
private void writeTimeslotDaysHeaders() { LocalDate previousTimeslotDay = null; int mergeStart = -1; for (Timeslot timeslot : solution.getTimeslotList()) { LocalDate timeslotDay = timeslot.getDate(); if (timeslotDay.equals(previousTimeslotDay)) { nextHeaderCell(""); } else { if (previousTimeslotDay != null) { currentSheet.addMergedRegion(new CellRangeAddress(currentRowNumber, currentRowNumber, mergeStart, currentColumnNumber)); } nextHeaderCell(DAY_FORMATTER.format(timeslotDay)); previousTimeslotDay = timeslotDay; mergeStart = currentColumnNumber; } } if (previousTimeslotDay != null) { currentSheet.addMergedRegion(new CellRangeAddress(currentRowNumber, currentRowNumber, mergeStart, currentColumnNumber)); } }
@Override public boolean equals(final Object o) { if (this == o) { return true; } if (!(o instanceof Java8Entity)) { return false; } final Java8Entity that = (Java8Entity) o; if (id != null ? !id.equals(that.id) : that.id != null) { return false; } if (instant != null ? !instant.equals(that.instant) : that.instant != null) { return false; } if (localDate != null ? !localDate.equals(that.localDate) : that.localDate != null) { return false; } if (localDateTime != null ? !localDateTime.equals(that.localDateTime) : that.localDateTime != null) { return false; } return localTime != null ? localTime.equals(that.localTime) : that.localTime == null; }
&& (this.getPassword() == null ? other.getPassword() == null : this.getPassword().equals(other.getPassword())) && (this.getGender() == null ? other.getGender() == null : this.getGender().equals(other.getGender())) && (this.getBirthday() == null ? other.getBirthday() == null : this.getBirthday().equals(other.getBirthday())) && (this.getLastLoginTime() == null ? other.getLastLoginTime() == null : this.getLastLoginTime().equals(other.getLastLoginTime())) && (this.getLastLoginIp() == null ? other.getLastLoginIp() == null : this.getLastLoginIp().equals(other.getLastLoginIp()))
readHeaderCell(""); for (LocalDate date = startDate; date.compareTo(endDate) < 0; date = date.plusDays(1)) { if (date.equals(startDate) || date.getDayOfMonth() == 1) { readHeaderCell(MONTH_FORMATTER.format(date)); } else {
LocalDate startDate = new LocalDate(2014, 1, 2); LocalDateTime startDateTime = new LocalDateTime(2014, 1, 2, 14, 0); LocalDate forCompare = startDateTime.toLocalDate(); System.out.println("equal dates: " + forCompare.equals(startDate)); // equal dates: true
static public Boolean sameDate ( DateTimeZone zone , DateTime dt1 , DateTime dt2 ) { LocalDate ld1 = new LocalDate( dt1.withZone( zone ) ); // LocalDate determination depends on the time zone. // So be sure the date-time values are adjusted to the same time zone. LocalDate ld2 = new LocalDate( dt2.withZone( zone ) ); return ld1.equals( ld2 ); }
return new Arrival(null, null, null, null); if (!arrivalDate.equals(showDate) && timeOfDay != RockTimeOfDay.EARLY) {
nextHeaderCell(""); for (LocalDate date = startDate; date.compareTo(endDate) < 0; date = date.plusDays(1)) { if (date.equals(startDate) || date.getDayOfMonth() == 1) { nextHeaderCell(MONTH_FORMATTER.format(date)); LocalDate startNextMonthDate = date.with(TemporalAdjusters.firstDayOfNextMonth());