Package com.easypost.easyvcr
Class TimeFrame
java.lang.Object
com.easypost.easyvcr.TimeFrame
TimeFrame used to store an extent of time.
-
Constructor Summary
ConstructorsConstructorDescriptionTimeFrame(int days, int hours, int minutes, int seconds)Constructor for TimeFrame. -
Method Summary
Modifier and TypeMethodDescriptionstatic TimeFrameforever()Get a TimeFrame that represents "forever".booleanhasLapsed(long fromTimeEpochTimestamp)Check if this time frame has lapsed from the given time.booleanCheck if this time frame has lapsed from the given time.static TimeFramemonths1()Get a TimeFrame that represents 1 month.static TimeFramemonths12()Get a TimeFrame that represents 12 months.static TimeFramemonths2()Get a TimeFrame that represents 2 months.static TimeFramemonths3()Get a TimeFrame that represents 3 months.static TimeFramemonths6()Get a TimeFrame that represents 6 months.static TimeFramenever()Get a TimeFrame that represents "never".
-
Constructor Details
-
TimeFrame
public TimeFrame(int days, int hours, int minutes, int seconds)Constructor for TimeFrame.- Parameters:
days- The number of days in the time frame.hours- The number of hours in the time frame.minutes- The number of minutes in the time frame.seconds- The number of seconds in the time frame.
-
-
Method Details
-
hasLapsed
Check if this time frame has lapsed from the given time.- Parameters:
fromTime- Time to add time frame to.- Returns:
- Whether this time frame has lapsed.
-
hasLapsed
public boolean hasLapsed(long fromTimeEpochTimestamp)Check if this time frame has lapsed from the given time.- Parameters:
fromTimeEpochTimestamp- Epoch timestamp of the time to add time frame to.- Returns:
- Whether this time frame has lapsed.
-
forever
Get a TimeFrame that represents "forever".- Returns:
- TimeFrame that represents "forever".
-
never
Get a TimeFrame that represents "never".- Returns:
- TimeFrame that represents "never".
-
months1
Get a TimeFrame that represents 1 month.- Returns:
- TimeFrame that represents 1 month.
-
months2
Get a TimeFrame that represents 2 months.- Returns:
- TimeFrame that represents 2 months.
-
months3
Get a TimeFrame that represents 3 months.- Returns:
- TimeFrame that represents 3 months.
-
months6
Get a TimeFrame that represents 6 months.- Returns:
- TimeFrame that represents 6 months.
-
months12
Get a TimeFrame that represents 12 months.- Returns:
- TimeFrame that represents 12 months.
-