Package org.cyclos.model.utils
Interface ITimeInterval
-
- All Superinterfaces:
Comparable<ITimeInterval>
- All Known Implementing Classes:
TimeInterval,TimeIntervalDTO
public interface ITimeInterval extends Comparable<ITimeInterval>
Common interface for time intervals
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default intcompareTo(ITimeInterval other)IntegergetAmount()TimeFieldgetField()default longgetMilliseconds()Returns the number of milliseconds in the given time interval.default booleanisValid()A time interval is empty if either amount or field are nullstatic booleanisValid(ITimeInterval interval)
-
-
-
Method Detail
-
isValid
static boolean isValid(ITimeInterval interval)
-
compareTo
default int compareTo(ITimeInterval other)
- Specified by:
compareToin interfaceComparable<ITimeInterval>
-
getAmount
Integer getAmount()
-
getField
TimeField getField()
-
getMilliseconds
default long getMilliseconds()
Returns the number of milliseconds in the given time interval. Months are considered to have 30 days, and years, 365 days. When either field is null, returns 0.
-
isValid
default boolean isValid()
A time interval is empty if either amount or field are null
-
-