Class EInterval.Builder
- java.lang.Object
 - 
- net.sf.eBus.messages.EMessageObject.Builder<M>
 - 
- net.sf.eBus.messages.EField.Builder<EInterval>
 - 
- net.sf.eBusx.time.EInterval.Builder
 
 
 
 
- 
- Enclosing class:
 - EInterval
 
public static final class EInterval.Builder extends EField.Builder<EInterval>
EIntervalinstances may be created only by using aBuilderinstance. ABuilderinstance is obtained by callingEInterval.builder()which returns a newly instantiatedBuilderinstance. It is recommended that a newBuilderinstance be used to create an interval rather than re-using a builder instance to create multiple intervals. 
- 
- 
Field Summary
- 
Fields inherited from class net.sf.eBus.messages.EMessageObject.Builder
mTargetClass 
 - 
 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EInterval.BuilderbeginClusivity(EInterval.Clusivity clusivity)Sets interval begin time clusivity.EInterval.BuilderbeginLocation(EInterval.TimeLocation location)Sets interval begin location.EInterval.BuilderbeginNow(EInterval.Clusivity clusivity)Sets interval begin time to current time and begin time location toEInterval.TimeLocation.NOWbut the clusivity to the given value.EInterval.BuilderbeginTime(java.time.Instant beginTime)Sets interval begin time.EInterval.BuilderbeginTime(java.time.Instant beginTime, EInterval.Clusivity clusivity)Sets interval begin time and clusivity.protected EIntervalbuildImpl()Returns a new interval instance based on this builder's settings.EInterval.BuilderendClusivity(EInterval.Clusivity clusivity)Sets interval end time clusivity.EInterval.BuilderendLocation(EInterval.TimeLocation location)Sets interval end location.EInterval.BuilderendNever()Sets interval end time toInstant.MAXand end time location toEInterval.TimeLocation.ON_GOING.EInterval.BuilderendNow(EInterval.Clusivity clusivity)Sets interval end time to current time and end time location toEInterval.TimeLocation.NOW.EInterval.BuilderendTime(java.time.Instant endTime)Sets the interval end time.EInterval.BuilderendTime(java.time.Instant endTime, EInterval.Clusivity clusivity)Sets interval end time and clusivity.EInterval.BuildernowOnly()Sets interval for current time only, inclusive.protected Validatorvalidate(Validator problems)Checks if: the begin and end times and clusivity are set and begin time is either < or ≤ end time depending on clusivity settings.- 
Methods inherited from class net.sf.eBus.messages.EMessageObject.Builder
build 
 - 
 
 - 
 
- 
- 
Method Detail
- 
validate
protected Validator validate(Validator problems)
Checks if:- the begin and end times and clusivity are set and
 - begin time is either < or ≤ end time depending on clusivity settings.
 - if begin time equals end time then both times must be inclusive.
 
- Overrides:
 validatein classEField.Builder<EInterval>- Parameters:
 problems- add each detected problem to this validator.- Returns:
 problems.- See Also:
 Validator
 
- 
buildImpl
protected EInterval buildImpl()
Returns a new interval instance based on this builder's settings.- Specified by:
 buildImplin classEMessageObject.Builder<EInterval>- Returns:
 - new interval instance.
 
 
- 
beginTime
public EInterval.Builder beginTime(java.time.Instant beginTime, EInterval.Clusivity clusivity)
Sets interval begin time and clusivity. Begin time location is based on whetherbeginTimeis < or ≥ to current time. Returnsthis Builderinstance so that builder method calls can be chained.- Parameters:
 beginTime- interval begin time.clusivity- interval begin time clusivity.- Returns:
 this Builderinstance.- Throws:
 java.lang.NullPointerException- if eitherbeginTimeorclusivityisnull. Note: if this is the case, then neither begin time nor clusivity is set.- See Also:
 beginNow(Clusivity)
 
- 
beginNow
public EInterval.Builder beginNow(EInterval.Clusivity clusivity)
Sets interval begin time to current time and begin time location toEInterval.TimeLocation.NOWbut the clusivity to the given value. When combined with clusivity defines whether interval begins at or just after now. Returnsthis Builderinstance so that builder method calls can be chained.- Parameters:
 clusivity- interval begin time clusivity.- Returns:
 this Builderinstance.- Throws:
 java.lang.NullPointerException- ifclusivityisnull. If this is the case, then begin time and location are not set.- See Also:
 beginTime(Instant, Clusivity)
 
- 
endTime
public EInterval.Builder endTime(java.time.Instant endTime, EInterval.Clusivity clusivity)
Sets interval end time and clusivity. End time location is based on whetherendTimeis < or ≥ to current time. Returnsthis Builderinstance so that builder method calls can be chained.- Parameters:
 endTime- interval end time.clusivity- interval end time clusivity.- Returns:
 this Builderinstance.- Throws:
 java.lang.NullPointerException- if eitherendTimeorclusivityisnull. Note: if this is the case, then neither end time nor clusivity is set.
 
- 
endNow
public EInterval.Builder endNow(EInterval.Clusivity clusivity)
Sets interval end time to current time and end time location toEInterval.TimeLocation.NOW. When combined with clusivity defines whether interval end at or just before now. Returnsthis Builderinstance so that builder method calls can be chained.- Parameters:
 clusivity- interval end time clusivity.- Returns:
 this Builderinstance.
 
- 
endNever
public EInterval.Builder endNever()
Sets interval end time toInstant.MAXand end time location toEInterval.TimeLocation.ON_GOING. Clusivity is set toexclusivebut is irrelevant since the end time is never reached. Returnsthis Builderinstance so that builder method calls can be chained.- Returns:
 this Builderinstance.
 
- 
nowOnly
public EInterval.Builder nowOnly()
Sets interval for current time only, inclusive. Both begin and end times are set to now, clusivity set to inclusive, and time location to now. Returnsthis Builderinstance so that builder method calls can be chained.- Returns:
 this Builderinstance.
 
- 
beginLocation
public EInterval.Builder beginLocation(EInterval.TimeLocation location)
Sets interval begin location. Returnsthis Builderinstance so that builder method calls can be chained.This method is required for
EIntervalde-serialization and should not be used for application purposes. Please usebeginTime(Instant, Clusivity)orbeginNow(Clusivity)instead.- Parameters:
 location- begin time location.- Returns:
 this Builderinstance.- Throws:
 java.lang.NullPointerException- iflocationisnull.- See Also:
 beginTime(Instant, Clusivity),beginNow(Clusivity)
 
- 
beginTime
public EInterval.Builder beginTime(java.time.Instant beginTime)
Sets interval begin time. Returnsthis Builderinstance so that builder method calls can be chained.This method is required for
EIntervalde-serialization and should not be used for application purposes. Please usebeginTime(Instant, Clusivity)orbeginNow(Clusivity)instead.- Parameters:
 beginTime- interval begin time.- Returns:
 this Builderinstance.- Throws:
 java.lang.NullPointerException- ifbeginTimeisnull.- See Also:
 beginTime(Instant, Clusivity),beginNow(Clusivity)
 
- 
beginClusivity
public EInterval.Builder beginClusivity(EInterval.Clusivity clusivity)
Sets interval begin time clusivity. Returnsthis Builderinstance so that builder method calls can be chained.This method is required for
EIntervalde-serialization and should not be used for application purposes. Please usebeginTime(Instant, Clusivity)orbeginNow(Clusivity)instead.- Parameters:
 clusivity- interval begin time clusivity.- Returns:
 this Builderinstance.- Throws:
 java.lang.NullPointerException- ifclusivityisnull.- See Also:
 beginTime(Instant, Clusivity),beginNow(Clusivity)
 
- 
endLocation
public EInterval.Builder endLocation(EInterval.TimeLocation location)
Sets interval end location. Returnsthis Builderinstance so that builder method calls can be chained.This method is required for
EIntervalde-serialization and should not be used for application purposes. Please useendTime(Instant, Clusivity),endNow(Clusivity), orendNever()instead.- Parameters:
 location- end time location.- Returns:
 this Builderinstance.- Throws:
 java.lang.NullPointerException- ifendTimeisnull.- See Also:
 endTime(Instant, Clusivity),endNow(Clusivity),endNever()
 
- 
endTime
public EInterval.Builder endTime(java.time.Instant endTime)
Sets the interval end time. Returnsthis Builderinstance so that builder method calls can be chained.This method is required for
EIntervalde-serialization and should not be used for application purposes. Please useendTime(Instant, Clusivity),endNow(Clusivity), orendNever()instead.- Parameters:
 endTime- interval end time.- Returns:
 this Builderinstance.- Throws:
 java.lang.NullPointerException- ifendTimeisnull.- See Also:
 endTime(Instant, Clusivity),endNow(Clusivity),endNever()
 
- 
endClusivity
public EInterval.Builder endClusivity(EInterval.Clusivity clusivity)
Sets interval end time clusivity. Returnsthis Builderinstance so that builder method calls can be chained.This method is required for
EIntervalde-serialization and should not be used for application purposes. Please useendTime(Instant, Clusivity),endNow(Clusivity), orendNever()instead.- Parameters:
 clusivity- interval begin time clusivity.- Returns:
 this Builderinstance.- Throws:
 java.lang.NullPointerException- ifclusivityisnull.- See Also:
 endTime(Instant, Clusivity),endNow(Clusivity),endNever()
 
 - 
 
 -