类java.time.temporal.TemporalQuery源码实例Demo

下面列出了怎么用java.time.temporal.TemporalQuery的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: dragonwell8_jdk   文件: DateTimePrintContext.java
/**
 * Gets a value using a query.
 *
 * @param query  the query to use, not null
 * @return the result, null if not found and optional is true
 * @throws DateTimeException if the type is not available and the section is not optional
 */
<R> R getValue(TemporalQuery<R> query) {
    R result = temporal.query(query);
    if (result == null && optional == 0) {
        throw new DateTimeException("Unable to extract value: " + temporal.getClass());
    }
    return result;
}
 
源代码2 项目: dragonwell8_jdk   文件: AbstractDateTimeTest.java
@Test
public void basicTest_query() {
    for (TemporalAccessor sample : samples()) {
        assertEquals(sample.query(new TemporalQuery<String>() {
            @Override
            public String queryFrom(TemporalAccessor temporal) {
                return "foo";
            }
        }), "foo");
    }
}
 
源代码3 项目: smallrye-graphql   文件: DateTransformer.java
@Override
public Temporal in(final String o) {
    TemporalQuery<?> temporalAccessor = TEMPORAL_QUERYS.get(targetClassName);

    if (temporalAccessor == null || dateTimeFormatter == null) {
        throw msg.notValidDateOrTimeType(targetClassName);
    }

    return (Temporal) dateTimeFormatter.parse(o.toString(), temporalAccessor);
}
 
源代码4 项目: smallrye-graphql   文件: DateTransformer.java
private static Map<String, TemporalQuery<?>> createTemporalQuerys() {
    Map<String, TemporalQuery<?>> defaultFormatter = new HashMap<>();

    defaultFormatter.put(LocalDate.class.getName(), LocalDate::from);
    defaultFormatter.put(LocalTime.class.getName(), LocalTime::from);
    defaultFormatter.put(LocalDateTime.class.getName(), LocalDateTime::from);
    defaultFormatter.put(OffsetTime.class.getName(), OffsetTime::from);
    defaultFormatter.put(OffsetDateTime.class.getName(), OffsetDateTime::from);
    defaultFormatter.put(ZonedDateTime.class.getName(), ZonedDateTime::from);

    return defaultFormatter;
}
 
源代码5 项目: TencentKona-8   文件: DateTimePrintContext.java
/**
 * Gets a value using a query.
 *
 * @param query  the query to use, not null
 * @return the result, null if not found and optional is true
 * @throws DateTimeException if the type is not available and the section is not optional
 */
<R> R getValue(TemporalQuery<R> query) {
    R result = temporal.query(query);
    if (result == null && optional == 0) {
        throw new DateTimeException("Unable to extract value: " + temporal.getClass());
    }
    return result;
}
 
源代码6 项目: TencentKona-8   文件: AbstractDateTimeTest.java
@Test
public void basicTest_query() {
    for (TemporalAccessor sample : samples()) {
        assertEquals(sample.query(new TemporalQuery<String>() {
            @Override
            public String queryFrom(TemporalAccessor temporal) {
                return "foo";
            }
        }), "foo");
    }
}
 
源代码7 项目: jdk8u60   文件: DateTimePrintContext.java
/**
 * Gets a value using a query.
 *
 * @param query  the query to use, not null
 * @return the result, null if not found and optional is true
 * @throws DateTimeException if the type is not available and the section is not optional
 */
<R> R getValue(TemporalQuery<R> query) {
    R result = temporal.query(query);
    if (result == null && optional == 0) {
        throw new DateTimeException("Unable to extract value: " + temporal.getClass());
    }
    return result;
}
 
源代码8 项目: openjdk-jdk8u   文件: TCKOffsetTime.java
@Test(dataProvider="query")
public <T> void test_queryFrom(TemporalAccessor temporal, TemporalQuery<T> query, T expected) {
    assertEquals(query.queryFrom(temporal), expected);
}
 
源代码9 项目: openjdk-jdk8u   文件: TCKLocalDateTime.java
@Test(dataProvider="query")
public <T> void test_queryFrom(TemporalAccessor temporal, TemporalQuery<T> query, T expected) {
    assertEquals(query.queryFrom(temporal), expected);
}
 
源代码10 项目: jdk8u60   文件: TCKYear.java
@Test(dataProvider="query")
public <T> void test_queryFrom(TemporalAccessor temporal, TemporalQuery<T> query, T expected) {
    assertEquals(query.queryFrom(temporal), expected);
}
 
ZoneIdPrinterParser(TemporalQuery<ZoneId> query, String description) {
    this.query = query;
    this.description = description;
}
 
源代码12 项目: jdk8u60   文件: TCKYear.java
@Test(dataProvider="query")
public <T> void test_query(TemporalAccessor temporal, TemporalQuery<T> query, T expected) {
    assertEquals(temporal.query(query), expected);
}
 
源代码13 项目: dragonwell8_jdk   文件: DateTimeFormatter.java
/** Constructor. */
public ClassicFormat(DateTimeFormatter formatter, TemporalQuery<?> parseType) {
    this.formatter = formatter;
    this.parseType = parseType;
}
 
源代码14 项目: jdk8u60   文件: DateTimeFormatter.java
/** Constructor. */
public ClassicFormat(DateTimeFormatter formatter, TemporalQuery<?> parseType) {
    this.formatter = formatter;
    this.parseType = parseType;
}
 
源代码15 项目: dragonwell8_jdk   文件: TCKYearMonth.java
@Test(dataProvider="query")
public <T> void test_query(TemporalAccessor temporal, TemporalQuery<T> query, T expected) {
    assertEquals(temporal.query(query), expected);
}
 
源代码16 项目: dragonwell8_jdk   文件: TCKYearMonth.java
@Test(dataProvider="query")
public <T> void test_queryFrom(TemporalAccessor temporal, TemporalQuery<T> query, T expected) {
    assertEquals(query.queryFrom(temporal), expected);
}
 
源代码17 项目: dragonwell8_jdk   文件: TCKYear.java
@Test(dataProvider="query")
public <T> void test_query(TemporalAccessor temporal, TemporalQuery<T> query, T expected) {
    assertEquals(temporal.query(query), expected);
}
 
源代码18 项目: dragonwell8_jdk   文件: TCKYear.java
@Test(dataProvider="query")
public <T> void test_queryFrom(TemporalAccessor temporal, TemporalQuery<T> query, T expected) {
    assertEquals(query.queryFrom(temporal), expected);
}
 
源代码19 项目: openjdk-jdk8u   文件: TCKMonthDay.java
@Test(dataProvider="query")
public <T> void test_query(TemporalAccessor temporal, TemporalQuery<T> query, T expected) {
    assertEquals(temporal.query(query), expected);
}
 
源代码20 项目: jdk8u60   文件: TCKDayOfWeek.java
@Test(dataProvider="query")
public <T> void test_queryFrom(TemporalAccessor temporal, TemporalQuery<T> query, T expected) {
    assertEquals(query.queryFrom(temporal), expected);
}
 
源代码21 项目: dragonwell8_jdk   文件: TCKDayOfWeek.java
@Test(dataProvider="query")
public <T> void test_query(TemporalAccessor temporal, TemporalQuery<T> query, T expected) {
    assertEquals(temporal.query(query), expected);
}
 
源代码22 项目: dragonwell8_jdk   文件: TCKDayOfWeek.java
@Test(dataProvider="query")
public <T> void test_queryFrom(TemporalAccessor temporal, TemporalQuery<T> query, T expected) {
    assertEquals(query.queryFrom(temporal), expected);
}
 
源代码23 项目: dragonwell8_jdk   文件: TCKLocalDateTime.java
@Test(dataProvider="query")
public <T> void test_query(TemporalAccessor temporal, TemporalQuery<T> query, T expected) {
    assertEquals(temporal.query(query), expected);
}
 
源代码24 项目: dragonwell8_jdk   文件: TCKLocalDateTime.java
@Test(dataProvider="query")
public <T> void test_queryFrom(TemporalAccessor temporal, TemporalQuery<T> query, T expected) {
    assertEquals(query.queryFrom(temporal), expected);
}
 
源代码25 项目: dragonwell8_jdk   文件: TCKLocalDate.java
@Test(dataProvider="query")
public <T> void test_query(TemporalAccessor temporal, TemporalQuery<T> query, T expected) {
    assertEquals(temporal.query(query), expected);
}
 
源代码26 项目: JDKSourceCode1.8   文件: DateTimeFormatter.java
/** Constructor. */
public ClassicFormat(DateTimeFormatter formatter, TemporalQuery<?> parseType) {
    this.formatter = formatter;
    this.parseType = parseType;
}
 
源代码27 项目: dragonwell8_jdk   文件: TCKLocalTime.java
@Test(dataProvider="query")
public <T> void test_query(TemporalAccessor temporal, TemporalQuery<T> query, T expected) {
    assertEquals(temporal.query(query), expected);
}
 
源代码28 项目: jdk8u60   文件: TCKOffsetDateTime.java
@Test(dataProvider="query")
public <T> void test_query(TemporalAccessor temporal, TemporalQuery<T> query, T expected) {
    assertEquals(temporal.query(query), expected);
}
 
源代码29 项目: openjdk-jdk8u   文件: DateTimeFormatter.java
/** Constructor. */
public ClassicFormat(DateTimeFormatter formatter, TemporalQuery<?> parseType) {
    this.formatter = formatter;
    this.parseType = parseType;
}
 
源代码30 项目: jdk8u60   文件: TCKMonthDay.java
@Test(dataProvider="query")
public <T> void test_query(TemporalAccessor temporal, TemporalQuery<T> query, T expected) {
    assertEquals(temporal.query(query), expected);
}
 
 类所在包
 同包方法