@Test public void shouldConvertListOfDatesToDateTimes() { List<Date> dates = asList(new Date(115, 9, 10, 8, 10, 10), null, new Date(116, 10, 23, 20, 22, 33)); List<DateTime> dateTimes = DateUtil.datesToDateTimes(dates); assertEquals(asList(new DateTime(2015, 10, 10, 8, 10, 10), null, new DateTime(2016, 11, 23, 20, 22,33)), dateTimes); }
public static List<DateTime> datesToDateTimes(List<Date> dates) { List<DateTime> dateTimes = new ArrayList<>(); for (Date date : dates) { if (date == null) { dateTimes.add(null); } else { dateTimes.add(new DateTime(date)); } } return dateTimes; }
DateUtil { public static List<DateTime> datesToDateTimes(List<Date> dates) { List<DateTime> dateTimes = new ArrayList<>(); for (Date date : dates) { if (date == null) { dateTimes.add(null); } else { dateTimes.add(new DateTime(date)); } } return dateTimes; } }
DateUtil { public static List<DateTime> datesToDateTimes(List<Date> dates) { List<DateTime> dateTimes = new ArrayList<>(); for (Date date : dates) { if (date == null) { dateTimes.add(null); } else { dateTimes.add(new DateTime(date)); } } return dateTimes; } private  DateUtil(); }
DateUtil { public static List<DateTime> datesToDateTimes(List<Date> dates) { List<DateTime> dateTimes = new ArrayList<>(); for (Date date : dates) { if (date == null) { dateTimes.add(null); } else { dateTimes.add(new DateTime(date)); } } return dateTimes; } private  DateUtil(); static DateTime now(); static DateTime nowUTC(); static LocalDate today(); static LocalDate tomorrow(); static LocalDate newDate(int year, int month, int day); static DateTime newDateTime(LocalDate localDate, int hour, int minute, int second); static DateTime setTimeZone(DateTime dateTime); static DateTime setTimeZoneUTC(DateTime dateTime); static DateTime newDateTime(Date date); static DateTime newDateTime(LocalDate date); static Time time(DateTime dateTime); static LocalDate newDate(Date date); static LocalDate newDate(DateTime dateTime); static int daysPast(LocalDate localDate, DayOfWeek dayOfWeek); static boolean isOnOrBefore(DateTime firstDate, DateTime secondDate); static boolean isOnOrAfter(DateTime firstDate, DateTime secondDate); static boolean inRange(DateTime reference, DateTime start, DateTime end); static int daysToCalendarWeekEnd(LocalDate date, int calendarWeekStartDay); static DateTime newDateTime(LocalDate localDate, Time time); static DateTime newDateTime(int year, int month, int day, Time time); static DateTime newDateTime(int year, int month, int day); static DateTime newDateTime(int year, int month, int day, int hour, int minute, int second); static int getDifferenceOfDatesInYears(Date startDate); static DateTime endOfDay(Date dateTime); static DateTime nextApplicableWeekDay(DateTime fromDate, List<DayOfWeek> applicableDays); static DateTime nextApplicableWeekDayIncludingFromDate(DateTime fromDate, List<DayOfWeek> applicableDays); static List<DateTime> greaterThanOrEqualTo(final DateTime date, final List<DateTime> dates); static List<DateTime> lessThan(final DateTime date, final List<DateTime> dates); static List<DayOfWeek> daysStarting(DayOfWeek day, int numberOfDays); static List<DateTime> datesToDateTimes(List<Date> dates); static Date toDate(DateTime dateTime); static DateTime toDateTimeAtStartOfDay(LocalDate localDate); }
DateUtil { public static List<DateTime> datesToDateTimes(List<Date> dates) { List<DateTime> dateTimes = new ArrayList<>(); for (Date date : dates) { if (date == null) { dateTimes.add(null); } else { dateTimes.add(new DateTime(date)); } } return dateTimes; } private  DateUtil(); static DateTime now(); static DateTime nowUTC(); static LocalDate today(); static LocalDate tomorrow(); static LocalDate newDate(int year, int month, int day); static DateTime newDateTime(LocalDate localDate, int hour, int minute, int second); static DateTime setTimeZone(DateTime dateTime); static DateTime setTimeZoneUTC(DateTime dateTime); static DateTime newDateTime(Date date); static DateTime newDateTime(LocalDate date); static Time time(DateTime dateTime); static LocalDate newDate(Date date); static LocalDate newDate(DateTime dateTime); static int daysPast(LocalDate localDate, DayOfWeek dayOfWeek); static boolean isOnOrBefore(DateTime firstDate, DateTime secondDate); static boolean isOnOrAfter(DateTime firstDate, DateTime secondDate); static boolean inRange(DateTime reference, DateTime start, DateTime end); static int daysToCalendarWeekEnd(LocalDate date, int calendarWeekStartDay); static DateTime newDateTime(LocalDate localDate, Time time); static DateTime newDateTime(int year, int month, int day, Time time); static DateTime newDateTime(int year, int month, int day); static DateTime newDateTime(int year, int month, int day, int hour, int minute, int second); static int getDifferenceOfDatesInYears(Date startDate); static DateTime endOfDay(Date dateTime); static DateTime nextApplicableWeekDay(DateTime fromDate, List<DayOfWeek> applicableDays); static DateTime nextApplicableWeekDayIncludingFromDate(DateTime fromDate, List<DayOfWeek> applicableDays); static List<DateTime> greaterThanOrEqualTo(final DateTime date, final List<DateTime> dates); static List<DateTime> lessThan(final DateTime date, final List<DateTime> dates); static List<DayOfWeek> daysStarting(DayOfWeek day, int numberOfDays); static List<DateTime> datesToDateTimes(List<Date> dates); static Date toDate(DateTime dateTime); static DateTime toDateTimeAtStartOfDay(LocalDate localDate);  }