All Downloads are FREE. Search and download functionalities are using the official Maven repository.

java.time.temporal.TemporalAccessor Maven / Gradle / Ivy

package java.time.temporal;

public interface TemporalAccessor {
	boolean isSupported(TemporalField field);

	long getLong(TemporalField field);

	default ValueRange range(TemporalField field) {
		if (field instanceof ChronoField) {
			return field.range();
		} else {
			return field.rangeRefinedBy(this);
		}
	}

	default int get(TemporalField field) {
		ValueRange range = range(field);
		long value = getLong(field);
		return (int) value;
	}

	default  R query(TemporalQuery query) {
		return query.queryFrom(this);
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy