@Test public void fromCalendarDaysOfWeekToISO() throws Exception { assertNotNull(DateUtils.fromCalendarDaysOfWeekToISO(null)); assertTrue(DateUtils.fromCalendarDaysOfWeekToISO(null).isEmpty()); assertNotNull(DateUtils.fromCalendarDaysOfWeekToISO(Collections.emptyList())); assertTrue(DateUtils.fromCalendarDaysOfWeekToISO(Collections.emptyList()).isEmpty()); List<DayOfWeek> dow; dow = DateUtils.fromCalendarDaysOfWeekToISO(Collections.singletonList(Calendar.MONDAY)); assertNotNull(dow); assertEquals(1, dow.size()); assertTrue(dow.contains(DayOfWeek.MONDAY)); dow = DateUtils.fromCalendarDaysOfWeekToISO(Collections.singletonList(Calendar.TUESDAY)); assertNotNull(dow); assertEquals(1, dow.size()); assertTrue(dow.contains(DayOfWeek.TUESDAY)); dow = DateUtils.fromCalendarDaysOfWeekToISO(Collections.singletonList(Calendar.WEDNESDAY)); assertNotNull(dow); assertEquals(1, dow.size()); assertTrue(dow.contains(DayOfWeek.WEDNESDAY)); dow = DateUtils.fromCalendarDaysOfWeekToISO(Collections.singletonList(Calendar.THURSDAY)); assertNotNull(dow); assertEquals(1, dow.size()); assertTrue(dow.contains(DayOfWeek.THURSDAY)); dow = DateUtils.fromCalendarDaysOfWeekToISO(Collections.singletonList(Calendar.FRIDAY)); assertNotNull(dow); assertEquals(1, dow.size()); assertTrue(dow.contains(DayOfWeek.FRIDAY)); dow = DateUtils.fromCalendarDaysOfWeekToISO(Collections.singletonList(Calendar.SATURDAY)); assertNotNull(dow); assertEquals(1, dow.size()); assertTrue(dow.contains(DayOfWeek.SATURDAY)); dow = DateUtils.fromCalendarDaysOfWeekToISO(Collections.singletonList(Calendar.SUNDAY)); assertNotNull(dow); assertEquals(1, dow.size()); assertTrue(dow.contains(DayOfWeek.SUNDAY)); dow = DateUtils.fromCalendarDaysOfWeekToISO(Arrays.asList(Calendar.MONDAY, Calendar.WEDNESDAY, Calendar.SUNDAY)); assertNotNull(dow); assertEquals(3, dow.size()); assertTrue(dow.contains(DayOfWeek.MONDAY)); assertTrue(dow.contains(DayOfWeek.WEDNESDAY)); assertTrue(dow.contains(DayOfWeek.SUNDAY)); }
public static List<DayOfWeek> fromCalendarDaysOfWeekToISO(final List<Integer> calendarDaysOfWeek) { if (calendarDaysOfWeek != null) { final List<DayOfWeek> iso = new ArrayList<>(calendarDaysOfWeek.size()); for (final Integer dow : calendarDaysOfWeek) { switch (dow) { case Calendar.MONDAY: iso.add(DayOfWeek.MONDAY); break; case Calendar.TUESDAY: iso.add(DayOfWeek.TUESDAY); break; case Calendar.WEDNESDAY: iso.add(DayOfWeek.WEDNESDAY); break; case Calendar.THURSDAY: iso.add(DayOfWeek.THURSDAY); break; case Calendar.FRIDAY: iso.add(DayOfWeek.FRIDAY); break; case Calendar.SATURDAY: iso.add(DayOfWeek.SATURDAY); break; case Calendar.SUNDAY: iso.add(DayOfWeek.SUNDAY); break; } } return iso; } return new ArrayList<>(0); }
DateUtils { public static List<DayOfWeek> fromCalendarDaysOfWeekToISO(final List<Integer> calendarDaysOfWeek) { if (calendarDaysOfWeek != null) { final List<DayOfWeek> iso = new ArrayList<>(calendarDaysOfWeek.size()); for (final Integer dow : calendarDaysOfWeek) { switch (dow) { case Calendar.MONDAY: iso.add(DayOfWeek.MONDAY); break; case Calendar.TUESDAY: iso.add(DayOfWeek.TUESDAY); break; case Calendar.WEDNESDAY: iso.add(DayOfWeek.WEDNESDAY); break; case Calendar.THURSDAY: iso.add(DayOfWeek.THURSDAY); break; case Calendar.FRIDAY: iso.add(DayOfWeek.FRIDAY); break; case Calendar.SATURDAY: iso.add(DayOfWeek.SATURDAY); break; case Calendar.SUNDAY: iso.add(DayOfWeek.SUNDAY); break; } } return iso; } return new ArrayList<>(0); } }
DateUtils { public static List<DayOfWeek> fromCalendarDaysOfWeekToISO(final List<Integer> calendarDaysOfWeek) { if (calendarDaysOfWeek != null) { final List<DayOfWeek> iso = new ArrayList<>(calendarDaysOfWeek.size()); for (final Integer dow : calendarDaysOfWeek) { switch (dow) { case Calendar.MONDAY: iso.add(DayOfWeek.MONDAY); break; case Calendar.TUESDAY: iso.add(DayOfWeek.TUESDAY); break; case Calendar.WEDNESDAY: iso.add(DayOfWeek.WEDNESDAY); break; case Calendar.THURSDAY: iso.add(DayOfWeek.THURSDAY); break; case Calendar.FRIDAY: iso.add(DayOfWeek.FRIDAY); break; case Calendar.SATURDAY: iso.add(DayOfWeek.SATURDAY); break; case Calendar.SUNDAY: iso.add(DayOfWeek.SUNDAY); break; } } return iso; } return new ArrayList<>(0); } private  DateUtils(); }
DateUtils { public static List<DayOfWeek> fromCalendarDaysOfWeekToISO(final List<Integer> calendarDaysOfWeek) { if (calendarDaysOfWeek != null) { final List<DayOfWeek> iso = new ArrayList<>(calendarDaysOfWeek.size()); for (final Integer dow : calendarDaysOfWeek) { switch (dow) { case Calendar.MONDAY: iso.add(DayOfWeek.MONDAY); break; case Calendar.TUESDAY: iso.add(DayOfWeek.TUESDAY); break; case Calendar.WEDNESDAY: iso.add(DayOfWeek.WEDNESDAY); break; case Calendar.THURSDAY: iso.add(DayOfWeek.THURSDAY); break; case Calendar.FRIDAY: iso.add(DayOfWeek.FRIDAY); break; case Calendar.SATURDAY: iso.add(DayOfWeek.SATURDAY); break; case Calendar.SUNDAY: iso.add(DayOfWeek.SUNDAY); break; } } return iso; } return new ArrayList<>(0); } private  DateUtils(); static ZoneId zone(); static String exportFileTimestamp(); static String exportFileTimestamp(final Instant instant); static String exportFileTimestamp(final LocalDateTime localDateTime); static String exportFileTimestamp(final ZonedDateTime zonedDateTime); static String numberTimestamp(final Instant instant); static String numberTimestamp(final LocalDateTime localDateTime); static String numberTimestamp(final ZonedDateTime zonedDateTime); static String impexFileTimestamp(); static String impexFileTimestamp(final Instant instant); static String impexFileTimestamp(final LocalDateTime localDateTime); static String impexFileTimestamp(final ZonedDateTime zonedDateTime); static String autoImportTimestamp(); static String autoImportTimestamp(final ZonedDateTime zonedDateTime); static LocalDate ldFrom(final long millis); static LocalDateTime ldtFrom(final long millis); static ZonedDateTime zdtFrom(final long millis); static Instant iFrom(final long millis); static Instant iFrom(final LocalDate localDate); static Instant iFrom(final LocalDateTime localDateTime); static Instant iFrom(final ZonedDateTime zonedDateTime); static long millis(final LocalDate localDate); static long millis(final LocalDateTime localDateTime); static long millis(final ZonedDateTime zonedDateTime); static Instant iParse(final String datetime, final String pattern); static LocalDate ldParse(final String datetime, final String pattern); static LocalDateTime ldtParse(final String datetime, final String pattern); static ZonedDateTime zdtParse(final String datetime, final String pattern); static Instant iParseSDT(final String datetime); static LocalDate ldParseSDT(final String datetime); static LocalDateTime ldtParseSDT(final String datetime); static ZonedDateTime zdtParseSDT(final String datetime); static String format(final Instant instant, final String pattern); static String format(final LocalDate date, final String pattern); static String format(final LocalDateTime datetime, final String pattern); static String format(final ZonedDateTime datetime, final String pattern); static String formatSDT(); static String formatSDT(final Instant instant); static String formatSDT(final LocalDate datetime); static String formatSDT(final LocalDateTime datetime); static String formatSDT(final ZonedDateTime datetime); static String formatSD(final LocalDate date); static String formatSD(final LocalDateTime date); static String formatSD(final ZonedDateTime date); static String formatYear(); static String formatCustomer(final Instant instant, final Locale locale); static String formatCustomer(final LocalDate date, final Locale locale); static String formatCustomer(final LocalDateTime date, final Locale locale); static String formatCustomer(final ZonedDateTime date, final Locale locale); static LocalDateTime ldtAtStartOfYear(final LocalDateTime date); static ZonedDateTime zdtAtStartOfYear(final ZonedDateTime date); static LocalDateTime ldtAtStartOfMonth(final LocalDateTime date); static ZonedDateTime zdtAtStartOfMonth(final ZonedDateTime date); static LocalDateTime ldtAtStartOfWeek(final LocalDateTime date); static ZonedDateTime zdtAtStartOfWeek(final ZonedDateTime date); static LocalDateTime ldtAtStartOfDay(final LocalDateTime date); static ZonedDateTime zdtAtStartOfDay(final ZonedDateTime date); static List<DayOfWeek> fromCalendarDaysOfWeekToISO(final List<Integer> calendarDaysOfWeek); static int fromISOtoCalendarDayOfWeek(final DayOfWeek dow); }
DateUtils { public static List<DayOfWeek> fromCalendarDaysOfWeekToISO(final List<Integer> calendarDaysOfWeek) { if (calendarDaysOfWeek != null) { final List<DayOfWeek> iso = new ArrayList<>(calendarDaysOfWeek.size()); for (final Integer dow : calendarDaysOfWeek) { switch (dow) { case Calendar.MONDAY: iso.add(DayOfWeek.MONDAY); break; case Calendar.TUESDAY: iso.add(DayOfWeek.TUESDAY); break; case Calendar.WEDNESDAY: iso.add(DayOfWeek.WEDNESDAY); break; case Calendar.THURSDAY: iso.add(DayOfWeek.THURSDAY); break; case Calendar.FRIDAY: iso.add(DayOfWeek.FRIDAY); break; case Calendar.SATURDAY: iso.add(DayOfWeek.SATURDAY); break; case Calendar.SUNDAY: iso.add(DayOfWeek.SUNDAY); break; } } return iso; } return new ArrayList<>(0); } private  DateUtils(); static ZoneId zone(); static String exportFileTimestamp(); static String exportFileTimestamp(final Instant instant); static String exportFileTimestamp(final LocalDateTime localDateTime); static String exportFileTimestamp(final ZonedDateTime zonedDateTime); static String numberTimestamp(final Instant instant); static String numberTimestamp(final LocalDateTime localDateTime); static String numberTimestamp(final ZonedDateTime zonedDateTime); static String impexFileTimestamp(); static String impexFileTimestamp(final Instant instant); static String impexFileTimestamp(final LocalDateTime localDateTime); static String impexFileTimestamp(final ZonedDateTime zonedDateTime); static String autoImportTimestamp(); static String autoImportTimestamp(final ZonedDateTime zonedDateTime); static LocalDate ldFrom(final long millis); static LocalDateTime ldtFrom(final long millis); static ZonedDateTime zdtFrom(final long millis); static Instant iFrom(final long millis); static Instant iFrom(final LocalDate localDate); static Instant iFrom(final LocalDateTime localDateTime); static Instant iFrom(final ZonedDateTime zonedDateTime); static long millis(final LocalDate localDate); static long millis(final LocalDateTime localDateTime); static long millis(final ZonedDateTime zonedDateTime); static Instant iParse(final String datetime, final String pattern); static LocalDate ldParse(final String datetime, final String pattern); static LocalDateTime ldtParse(final String datetime, final String pattern); static ZonedDateTime zdtParse(final String datetime, final String pattern); static Instant iParseSDT(final String datetime); static LocalDate ldParseSDT(final String datetime); static LocalDateTime ldtParseSDT(final String datetime); static ZonedDateTime zdtParseSDT(final String datetime); static String format(final Instant instant, final String pattern); static String format(final LocalDate date, final String pattern); static String format(final LocalDateTime datetime, final String pattern); static String format(final ZonedDateTime datetime, final String pattern); static String formatSDT(); static String formatSDT(final Instant instant); static String formatSDT(final LocalDate datetime); static String formatSDT(final LocalDateTime datetime); static String formatSDT(final ZonedDateTime datetime); static String formatSD(final LocalDate date); static String formatSD(final LocalDateTime date); static String formatSD(final ZonedDateTime date); static String formatYear(); static String formatCustomer(final Instant instant, final Locale locale); static String formatCustomer(final LocalDate date, final Locale locale); static String formatCustomer(final LocalDateTime date, final Locale locale); static String formatCustomer(final ZonedDateTime date, final Locale locale); static LocalDateTime ldtAtStartOfYear(final LocalDateTime date); static ZonedDateTime zdtAtStartOfYear(final ZonedDateTime date); static LocalDateTime ldtAtStartOfMonth(final LocalDateTime date); static ZonedDateTime zdtAtStartOfMonth(final ZonedDateTime date); static LocalDateTime ldtAtStartOfWeek(final LocalDateTime date); static ZonedDateTime zdtAtStartOfWeek(final ZonedDateTime date); static LocalDateTime ldtAtStartOfDay(final LocalDateTime date); static ZonedDateTime zdtAtStartOfDay(final ZonedDateTime date); static List<DayOfWeek> fromCalendarDaysOfWeekToISO(final List<Integer> calendarDaysOfWeek); static int fromISOtoCalendarDayOfWeek(final DayOfWeek dow);  }