Package org.threeten.bp.jdk8

Examples of org.threeten.bp.jdk8.DefaultInterfaceEra


        assertEquals(ZonedDateTime.from(TEST_DATE_TIME_PARIS), TEST_DATE_TIME_PARIS);
    }

    @Test
    public void factory_from_DateTimeAccessor_LDT_ZoneId() {
        assertEquals(ZonedDateTime.from(new DefaultInterfaceTemporalAccessor() {
            @Override
            public boolean isSupported(TemporalField field) {
                return TEST_DATE_TIME_PARIS.toLocalDateTime().isSupported(field);
            }
            @Override
View Full Code Here


        }), TEST_DATE_TIME_PARIS);
    }

    @Test
    public void factory_from_DateTimeAccessor_Instant_ZoneId() {
        assertEquals(ZonedDateTime.from(new DefaultInterfaceTemporalAccessor() {
            @Override
            public boolean isSupported(TemporalField field) {
                return field == INSTANT_SECONDS || field == NANO_OF_SECOND;
            }
            @Override
View Full Code Here

        } else {
            effectiveDate = null;
        }

        // need class here to handle non-standard cases
        return new DefaultInterfaceTemporalAccessor() {
            @Override
            public boolean isSupported(TemporalField field) {
                if (effectiveDate != null && field.isDateBased()) {
                    return effectiveDate.isSupported(field);
                }
View Full Code Here

     * @param style  the length of the text required, not null
     * @param locale  the locale to use, not null
     * @return the text value of the zone, not null
     */
    public String getDisplayName(TextStyle style, Locale locale) {
        return new DateTimeFormatterBuilder().appendZoneText(style).toFormatter(locale).format(new DefaultInterfaceTemporalAccessor() {
            @Override
            public boolean isSupported(TemporalField field) {
                return false;
            }
            @Override
View Full Code Here

        assertEquals(DateTimeFormatter.ISO_ORDINAL_DATE.format(test), "+123456-155Z");
    }

    @Test
    public void test_print_isoOrdinalDate_fields() {
        TemporalAccessor test = new DefaultInterfaceTemporalAccessor() {
            @Override
            public boolean isSupported(TemporalField field) {
                return field == YEAR || field == DAY_OF_YEAR;
            }
            @Override
View Full Code Here

     * @param style  the style of the text required, not null
     * @param locale  the locale to use, not null
     * @return the text value of the chronology, not null
     */
    public String getDisplayName(TextStyle style, Locale locale) {
        return new DateTimeFormatterBuilder().appendChronologyText(style).toFormatter(locale).format(new DefaultInterfaceTemporalAccessor() {
            @Override
            public boolean isSupported(TemporalField field) {
                return false;
            }
            @Override
View Full Code Here

TOP

Related Classes of org.threeten.bp.jdk8.DefaultInterfaceEra

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.