Class Days

java.lang.Object
net.andreinc.mockneat.abstraction.MockUnitBase
net.andreinc.mockneat.unit.time.Days
All Implemented Interfaces:
MockUnit<java.time.DayOfWeek>, MockUnitDays

public class Days
extends MockUnitBase
implements MockUnitDays
  • Constructor Details

  • Method Details

    • days

      public static Days days()

      Returns a Days object that can be used to generate a random java.time.DayOfWeek object.

      Note: By default the Days object returns a random day of the week.

      Returns:
      A re-usable Days object. The Days class implements MockUnitDays interface.
    • supplier

      public java.util.function.Supplier<java.time.DayOfWeek> supplier()
      Description copied from interface: MockUnit
      This is the sole abstract method of the interface. Needs to be implemented every-time a MockUnit is implemented.
      Specified by:
      supplier in interface MockUnit<java.time.DayOfWeek>
      Returns:
      A Supplier<T>.
    • rangeClosed

      public MockUnitDays rangeClosed​(java.time.DayOfWeek lower, java.time.DayOfWeek upper)
      Creates a new MockUnitDays that is used to generate a day of the week in the closed ranged [lower, upper].
      Parameters:
      lower - The lower limit of the interval.
      upper - The upper limit of the interval.
      Returns:
      A new MockUnitDays.
    • range

      public MockUnitDays range​(java.time.DayOfWeek lower, java.time.DayOfWeek upper)
      Creates a new MockUnitDays that is used to generate a day of the week in the open range [lower, upper).
      Parameters:
      lower - The lower limit of the interval.
      upper - The upper limit of the interval.
      Returns:
      A new MockUnitDays
    • before

      public MockUnitDays before​(java.time.DayOfWeek before)
      Creates a MockUnitDays that is used to generate a day of the week before the given limit.
      Parameters:
      before - The upper limit.
      Returns:
      A new MockUnitDays
    • after

      public MockUnitDays after​(java.time.DayOfWeek after)
      Creates a MockUnitDays that is used to generate a day of the week after the given limit.
      Parameters:
      after - The lower limit.
      Returns:
      A new MockUnitDays.