
org.opentripplanner.ext.dataoverlay.configuration.TimeUnit Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of otp Show documentation
Show all versions of otp Show documentation
The OpenTripPlanner multimodal journey planning system
The newest version!
package org.opentripplanner.ext.dataoverlay.configuration;
import java.time.temporal.ChronoUnit;
import java.time.temporal.Temporal;
public enum TimeUnit {
MS_EPOCH(ChronoUnit.MILLIS),
SECONDS(ChronoUnit.SECONDS),
HOURS(ChronoUnit.HOURS);
private final ChronoUnit chronoUnit;
TimeUnit(ChronoUnit chronoUnit) {
this.chronoUnit = chronoUnit;
}
public int between(Temporal temporal1Inclusive, Temporal temporal2Exclusive) {
return (int) asChronoUnit().between(temporal1Inclusive, temporal2Exclusive);
}
private ChronoUnit asChronoUnit() {
return chronoUnit;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy