Package net.sf.eBusx.io
Class EFileNotification.Builder
- java.lang.Object
-
- net.sf.eBus.messages.EMessageObject.Builder<M>
-
- net.sf.eBus.messages.EMessage.Builder<M,B>
-
- net.sf.eBus.messages.ENotificationMessage.Builder<EFileNotification,EFileNotification.Builder>
-
- net.sf.eBusx.io.EFileNotification.Builder
-
- Enclosing class:
- EFileNotification
public static final class EFileNotification.Builder extends ENotificationMessage.Builder<EFileNotification,EFileNotification.Builder>
-
-
Field Summary
-
Fields inherited from class net.sf.eBus.messages.ENotificationMessage.Builder
mPosition, mPubId
-
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 EFileNotification
buildImpl()
Returns eBus message instance built from the configured properties.EFileNotification.Builder
eventType(EFileNotification.EventType type)
Sets the detected file event type.EFileNotification.Builder
file(java.io.File file)
Sets the file associated with the notification.EFileNotification.Builder
lastModified(long timestamp)
Sets the event timestamp.EFileNotification.Builder
length(long length)
Sets the file length.protected Validator
validate(Validator problems)
Checks if message subject and message type are configured.-
Methods inherited from class net.sf.eBus.messages.ENotificationMessage.Builder
position, publisherId
-
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 EFileNotification buildImpl()
Description copied from class:EMessageObject.Builder
Returns eBus message instance built from the configured properties. Note: the builder configuration wasvalidated
prior to calling this method. The message object may now be constructed.- Specified by:
buildImpl
in classEMessageObject.Builder<EFileNotification>
- Returns:
- target message class instance.
-
validate
protected Validator validate(Validator problems)
Description copied from class:EMessage.Builder
Checks if message subject and message type are configured. If not, then text explaining this error is appended toproblems
.This method should be overridden by subclass message builders and called before doing its own validation. The first line in the subclass
validate
implementation should besuper.validate(problems);
.When overriding this method, be sure to add all discovered validation problems to the list. The validation method should consist of a series of individual
if
statements and not anif/else if
chain. That way all problems are found and not just the first one.Please see
Validator
for a validationBuilder
settings example.- Overrides:
validate
in classEMessage.Builder<EFileNotification,EFileNotification.Builder>
- Parameters:
problems
- used to check field validity and collect discovered invalid fields.- Returns:
problems
to allow for method chaining.- See Also:
Validator
-
file
public EFileNotification.Builder file(java.io.File file)
Sets the file associated with the notification.- Parameters:
file
- notification applies to this file.- Returns:
this Builder
- Throws:
java.lang.NullPointerException
- iffile
isnull
.
-
eventType
public EFileNotification.Builder eventType(EFileNotification.EventType type)
Sets the detected file event type.- Parameters:
type
- detected event type.- Returns:
this Builder
.- Throws:
java.lang.NullPointerException
- iftype
isnull
.
-
lastModified
public EFileNotification.Builder lastModified(long timestamp)
Sets the event timestamp.- Parameters:
timestamp
- event timestamp.- Returns:
this Builder
.
-
length
public EFileNotification.Builder length(long length)
Sets the file length.- Parameters:
length
- file length.- Returns:
this Builder
.
-
-