Package edu.ie3.datamodel.models
Class OperationTime
java.lang.Object
edu.ie3.datamodel.models.OperationTime
- All Implemented Interfaces:
Serializable
Time for which something is operated, can be limited to a time frame with one or two bounds or
not limited which is by definition equal to always on
- See Also:
-
Nested Class Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
OperationTime
(ZonedDateTime startDate, ZonedDateTime endDate, boolean isLimited) Constructor for builder only -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
boolean
Optional<edu.ie3.util.interval.ClosedInterval<ZonedDateTime>>
int
hashCode()
boolean
includes
(ZonedDateTime date) Check if given date is included in the operation time frameboolean
static OperationTime
toString()
-
Constructor Details
-
OperationTime
Constructor for builder only- Parameters:
startDate
- Beginning of the operation periodendDate
- End of the operation periodisLimited
- true, if operation is timely bound
-
-
Method Details
-
notLimited
- Returns:
- an OperationTime without time limitations (= always on)
-
getStartDate
- Returns:
- date of operation start, if present
-
getEndDate
- Returns:
- date of operation end, if present
-
isLimited
public boolean isLimited() -
getOperationLimit
- Returns:
- Optional.empty(), if the time frame is unlimited
Optional.of(ClosedInterval(startDate, endDate)), if the upper and lower bound is set
Optional.of((ClosedInterval(startDate, LocalDateTime.MAX)), if only the lower bound is set
Optional.of((ClosedInterval(LocalDateTime.MIN, endDate)), if only the upper bound is set
-
includes
Check if given date is included in the operation time frame- Parameters:
date
- Questioned date- Returns:
- true, if the date is included or there are no operation time limitations, else false
-
equals
-
hashCode
public int hashCode() -
toString
-
builder
- Returns:
- OperationTimeBuilder instance
-