Package net.andreinc.mockneat.unit.time
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
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description MockUnitDaysafter(java.time.DayOfWeek after)Creates aMockUnitDaysthat is used to generate a day of the week after the given limit.MockUnitDaysbefore(java.time.DayOfWeek before)Creates aMockUnitDaysthat is used to generate a day of the week before the given limit.static Daysdays()Returns aDaysobject that can be used to generate a randomjava.time.DayOfWeekobject.MockUnitDaysrange(java.time.DayOfWeek lower, java.time.DayOfWeek upper)Creates a newMockUnitDaysthat is used to generate a day of the week in the open range [lower,upper).MockUnitDaysrangeClosed(java.time.DayOfWeek lower, java.time.DayOfWeek upper)Creates a newMockUnitDaysthat is used to generate a day of the week in the closed ranged [lower,upper].java.util.function.Supplier<java.time.DayOfWeek>supplier()This is the sole abstract method of the interface.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.andreinc.mockneat.abstraction.MockUnit
array, array, collection, collection, collection, collection, collection, collection, consume, consume, get, get, list, list, list, list, list, list, map, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapToDouble, mapToInt, mapToLocalDate, mapToLong, mapToString, mapToString, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, serialize, set, set, set, set, set, set, stream, val, val, valStr, valStrMethods inherited from interface net.andreinc.mockneat.abstraction.MockUnitDays
display, display, display
-
Constructor Details
-
Method Details
-
days
Returns a
Daysobject that can be used to generate a randomjava.time.DayOfWeekobject.Note: By default the
Daysobject returns a random day of the week.- Returns:
- A re-usable
Daysobject. TheDaysclass implementsMockUnitDaysinterface.
-
supplier
public java.util.function.Supplier<java.time.DayOfWeek> supplier()Description copied from interface:MockUnitThis is the sole abstract method of the interface. Needs to be implemented every-time a MockUnit is implemented. -
rangeClosed
Creates a newMockUnitDaysthat 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
Creates a newMockUnitDaysthat 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
Creates aMockUnitDaysthat is used to generate a day of the week before the given limit.- Parameters:
before- The upper limit.- Returns:
- A new
MockUnitDays
-
after
Creates aMockUnitDaysthat is used to generate a day of the week after the given limit.- Parameters:
after- The lower limit.- Returns:
- A new
MockUnitDays.
-