Class AbstractDateRange<SELF extends AbstractDateRange<SELF>>
java.lang.Object
software.xdev.vaadin.daterange_picker.business.AbstractDateRange<SELF>
- Type Parameters:
SELF- implementer
- All Implemented Interfaces:
DateRange
- Direct Known Subclasses:
SimpleDateRange
public abstract class AbstractDateRange<SELF extends AbstractDateRange<SELF>>
extends Object
implements DateRange
Basic implementation of
DateRange-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionTrys to return the calculatedDateRangeResultfor the supplied datefrom(AbstractDateRange<?> dateRange) Retunns the default description, e.g.getKey()Returns the identification key, e.g.Returns thePeriodto move the date, if anybooleanbooleanbooleanReturns if theDateRangeis settable from a date
Example:falsefor TODAYtruefor MONTHtruefor FREEmoveDateRange(LocalDate date, int dif) Trys to return a movedDateRangeResultself()withCalcable(boolean calcable) withCalcForFunc(Function<LocalDate, DateRangeResult> calcForFunc) withDefaultDesc(String defaultDesc) withMovable(boolean movable) withMoveFunc(BiFunction<LocalDate, Integer, Optional<DateRangeResult>> moveFunc) withMovePeriod(Period period) withOptCalcForFunc(Function<LocalDate, Optional<DateRangeResult>> calcForFunc) withSettable(boolean settable)
-
Constructor Details
-
AbstractDateRange
public AbstractDateRange()
-
-
Method Details
-
self
-
withKey
-
withMovePeriod
-
withDefaultDesc
-
withCalcForFunc
-
withOptCalcForFunc
-
withMoveFunc
-
withMovable
-
withCalcable
-
withSettable
-
from
-
getKey
Description copied from interface:DateRangeReturns the identification key, e.g. DAY, MONTH, etc -
getOptMovePeriod
Description copied from interface:DateRangeReturns thePeriodto move the date, if any- Specified by:
getOptMovePeriodin interfaceDateRange- Returns:
Periodto move the date
-
getDefaultDescription
Description copied from interface:DateRangeRetunns the default description, e.g. "Day" or "Half year"- Specified by:
getDefaultDescriptionin interfaceDateRange- Returns:
- default description
-
isMovable
public boolean isMovable()Description copied from interface:DateRange -
isCalcable
public boolean isCalcable()Description copied from interface:DateRange- Specified by:
isCalcablein interfaceDateRange- Returns:
- if the
DateRangeis calcable
-
isSettable
public boolean isSettable()Description copied from interface:DateRangeReturns if theDateRangeis settable from a date
Example:-
falsefor TODAY -
truefor MONTH -
truefor FREE
- Specified by:
isSettablein interfaceDateRange- Returns:
- if the
DateRangeis settable from a date
-
-
getCalcForFunc
-
getMoveFunc
-
calcFor
Description copied from interface:DateRangeTrys to return the calculatedDateRangeResultfor the supplied date- Specified by:
calcForin interfaceDateRange- Parameters:
date- date that is used for calculation- Returns:
- calculated
DateRangeResult
-
moveDateRange
Description copied from interface:DateRangeTrys to return a movedDateRangeResult- Specified by:
moveDateRangein interfaceDateRange- Parameters:
date- Date that is used as a basedif- Count of moves- Returns:
- moved
DateRangeResult
-