net.time4j.engine.ThreetenAdapter Maven / Gradle / Ivy
/*
* -----------------------------------------------------------------------
* Copyright © 2013-2015 Meno Hochschild,
* -----------------------------------------------------------------------
* This file (ThreetenAdapter.java) is part of project Time4J.
*
* Time4J is free software: You can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation, either version 2.1 of the License, or
* (at your option) any later version.
*
* Time4J is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Time4J. If not, see .
* -----------------------------------------------------------------------
*/
package net.time4j.engine;
import java.time.temporal.TemporalAccessor;
import java.time.temporal.TemporalField;
import java.time.temporal.TemporalQuery;
import java.time.temporal.ValueRange;
/**
* Defines the implementing chronological entity as {@code TemporalAccessor}.
*
* @author Meno Hochschild
* @since 4.0
*/
/*[deutsch]
* Definiert die implementierende chronologische Entität als {@code TemporalAccessor}.
*
* @author Meno Hochschild
* @since 4.0
*/
public interface ThreetenAdapter
extends TemporalAccessor {
//~ Methoden ----------------------------------------------------------
/**
* Converts this object to a {@code TemporalAccessor}.
*
* Any implementation is required to return a new object with a different concrete type,
* not this instance.
*
* @return converted Threeten-object (always as new object)
* @since 4.0
*/
/*[deutsch]
* Konvertiert dieses Objekt zu einem {@code TemporalAccessor}.
*
* Jedwede Implementierung ist angehalten, ein neues Objekt mit einem anderen Typ
* statt dieser Instanz zurückzugeben.
*
* @return converted Threeten-object
* @since 4.0
*/
TemporalAccessor toTemporalAccessor();
@Override
default boolean isSupported(TemporalField field) {
return this.toTemporalAccessor().isSupported(field);
}
@Override
default ValueRange range(TemporalField field) {
return this.toTemporalAccessor().range(field);
}
@Override
default int get(TemporalField field) {
return this.toTemporalAccessor().get(field);
}
@Override
default long getLong(TemporalField field) {
return this.toTemporalAccessor().getLong(field);
}
@Override
default R query(TemporalQuery query) {
return this.toTemporalAccessor().query(query);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy