Package net.sf.eBusx.util
Class TimerRequest.Builder
- java.lang.Object
-
- net.sf.eBus.messages.EMessageObject.Builder<M>
-
- net.sf.eBus.messages.EMessage.Builder<M,B>
-
- net.sf.eBus.messages.ERequestMessage.Builder<TimerRequest,TimerRequest.Builder>
-
- net.sf.eBusx.util.TimerRequest.Builder
-
- Enclosing class:
- TimerRequest
public static final class TimerRequest.Builder extends ERequestMessage.Builder<TimerRequest,TimerRequest.Builder>
-
-
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 protected TimerRequest
buildImpl()
Returns a newTimerRequest
instance based on the builder's current configuration.TimerRequest.Builder
delay(long delay)
TimerRequest.Builder
fixedRate(boolean flag)
TimerRequest.Builder
period(long period)
TimerRequest.Builder
time(java.time.Instant time)
TimerRequest.Builder
timerName(java.lang.String name)
Sets the timer name.protected Validator
validate(Validator problems)
Validates current builder configuration prior to building theTimerRequest
instance.-
Methods inherited from class net.sf.eBus.messages.EMessage.Builder
copy, subject, timestamp, timestamp
-
Methods inherited from class net.sf.eBus.messages.EMessageObject.Builder
build
-
-
-
-
Method Detail
-
buildImpl
protected TimerRequest buildImpl()
Returns a newTimerRequest
instance based on the builder's current configuration. This method is called only after the builder configuration is successfully validated.- Specified by:
buildImpl
in classEMessageObject.Builder<TimerRequest>
- Returns:
- new
TimerRequest
instance.
-
validate
protected Validator validate(Validator problems)
Validates current builder configuration prior to building theTimerRequest
instance. A valid configuration requires that:- timer name is set and
- either time or delay set but not both.
- Overrides:
validate
in classEMessage.Builder<TimerRequest,TimerRequest.Builder>
- Parameters:
problems
- add configuration problems to thisValidator
.- Returns:
problems
to allow forValidator
method chaining.- See Also:
Validator
-
timerName
public TimerRequest.Builder timerName(java.lang.String name)
Sets the timer name.- Parameters:
name
- timer name.- Returns:
this TimerReply
builder.- Throws:
java.lang.IllegalArgumentException
- ifname
isnull
or empty.
-
time
public TimerRequest.Builder time(java.time.Instant time)
-
delay
public TimerRequest.Builder delay(long delay)
-
period
public TimerRequest.Builder period(long period)
-
fixedRate
public TimerRequest.Builder fixedRate(boolean flag)
-
-