Example usage for java.time YearMonth query

List of usage examples for java.time YearMonth query

Introduction

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

Prototype

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

Source Link

Document

Queries this year-month using the specified query.

Usage

From source file:Main.java

public static void main(String[] args) {
    YearMonth y = YearMonth.now();
    Chronology s = y.query(TemporalQueries.chronology());
    System.out.println(s);/*from ww w  .j  av a2s  .c om*/

}

From source file:Main.java

public static void main(String[] args) {

    YearMonth yearMonth = YearMonth.of(2014, 6);
    System.out.println(yearMonth.query(new SchoolHolidayQuery())); // false
    System.out.println(YearMonth.of(2014, Month.JULY).query(new SchoolHolidayQuery())); // true
    System.out.println(YearMonth.of(2014, 8).query(new SchoolHolidayQuery())); // true

}