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
-
Fields inherited from class net.andreinc.mockneat.abstraction.MockUnitBase
mockNeat
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods 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, wait
-
Methods 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, valStr
-
Methods inherited from interface net.andreinc.mockneat.abstraction.MockUnitDays
display, display, display
-
-
-
-
Constructor Detail
-
Days
protected Days()
-
Days
public Days(MockNeat mockNeat)
-
-
Method Detail
-
days
public static Days 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
public MockUnitDays rangeClosed(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].- 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 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
public MockUnitDays before(java.time.DayOfWeek 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
public MockUnitDays after(java.time.DayOfWeek 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.
-
-