Class TimeFrame

java.lang.Object
com.easypost.easyvcr.TimeFrame

public class TimeFrame extends Object
TimeFrame used to store an extent of time.
  • 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

      public boolean hasLapsed(Instant fromTime)
      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

      public static TimeFrame forever()
      Get a TimeFrame that represents "forever".
      Returns:
      TimeFrame that represents "forever".
    • never

      public static TimeFrame never()
      Get a TimeFrame that represents "never".
      Returns:
      TimeFrame that represents "never".
    • months1

      public static TimeFrame months1()
      Get a TimeFrame that represents 1 month.
      Returns:
      TimeFrame that represents 1 month.
    • months2

      public static TimeFrame months2()
      Get a TimeFrame that represents 2 months.
      Returns:
      TimeFrame that represents 2 months.
    • months3

      public static TimeFrame months3()
      Get a TimeFrame that represents 3 months.
      Returns:
      TimeFrame that represents 3 months.
    • months6

      public static TimeFrame months6()
      Get a TimeFrame that represents 6 months.
      Returns:
      TimeFrame that represents 6 months.
    • months12

      public static TimeFrame months12()
      Get a TimeFrame that represents 12 months.
      Returns:
      TimeFrame that represents 12 months.