Example usage for java.time DayOfWeek query

List of usage examples for java.time DayOfWeek query

Introduction

In this page you can find the example usage for java.time DayOfWeek query.

Prototype

@SuppressWarnings("unchecked")
@Override
public <R> R query(TemporalQuery<R> query) 

Source Link

Document

Queries this day-of-week using the specified query.

Usage

From source file:Main.java

public static void main(String[] args) {
    LocalDate localDate = LocalDate.of(2014, Month.JUNE, 21);
    DayOfWeek dayOfWeek = DayOfWeek.from(localDate);

    TemporalQuery<TemporalUnit> localDateQuery = TemporalQueries.precision();

    System.out.println(dayOfWeek.query(localDateQuery));
}