Get days In Week - Java java.time

Java examples for java.time:Week

Description

Get days In Week

Demo Code


    //package com.java2s;
    import java.time.DayOfWeek;
    import java.time.LocalDate;

    import java.util.Arrays;
    import java.util.List;
    import static java.util.stream.Collectors.toList;

    public class Main {
        public static List<LocalDate> daysInWeek(LocalDate dayInWeek) {
            return Arrays.asList(DayOfWeek.values()).stream()
                         .map(dayInWeek::with)
                         .collect(toList());
        }/* w w  w  .  jav a2s. c  om*/
    }

Related Tutorials