Package net.sf.eBusx.monitor
Class ApplicationInfo.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<ApplicationInfo,ApplicationInfo.Builder>
-
- net.sf.eBusx.monitor.ApplicationInfo.Builder
-
- Enclosing class:
- ApplicationInfo
public static final class ApplicationInfo.Builder extends ENotificationMessage.Builder<ApplicationInfo,ApplicationInfo.Builder>
Builder class used to construct anApplicationInfo
instance. ABuilder
instance is accessed via theApplicationInfo.builder()
method.
-
-
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 ApplicationInfo.Builder
appName(java.lang.String name)
Sets application name to given value.ApplicationInfo.Builder
appVersion(java.lang.String version)
ApplicationInfo.Builder
attributes(EField attributes)
protected ApplicationInfo
buildImpl()
Returns anApplicationInfo
instance based on this builder's configuration.ApplicationInfo.Builder
copyright(java.lang.String copyright)
ApplicationInfo.Builder
description(java.lang.String description)
ApplicationInfo.Builder
hostName(java.lang.String name)
Sets host name to given value.protected Validator
validate(Validator problems)
Validates the builder configuration.-
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 ApplicationInfo buildImpl()
Returns anApplicationInfo
instance based on this builder's configuration. This method is called only after the builder configuration is successfully validated.- Specified by:
buildImpl
in classEMessageObject.Builder<ApplicationInfo>
- Returns:
- new
ApplicationInfo
instance.
-
validate
protected Validator validate(Validator problems)
Validates the builder configuration. A valid configuration requires that the application name and version be set.- Overrides:
validate
in classEMessage.Builder<ApplicationInfo,ApplicationInfo.Builder>
- Parameters:
problems
- add configuration problems to- Returns:
problems
to allow forValidator
method chaining.- See Also:
Validator
-
hostName
public ApplicationInfo.Builder hostName(java.lang.String name)
Sets host name to given value. This name does not need to be a network host name but any name meaningful to the application and those monitoring it.- Parameters:
name
- host name.- Returns:
this Builder
instance.- Throws:
java.lang.IllegalArgumentException
- ifname
is eithernull
or empty.
-
appName
public ApplicationInfo.Builder appName(java.lang.String name)
Sets application name to given value.- Parameters:
name
- application name.- Returns:
this Builder
instance.- Throws:
java.lang.IllegalArgumentException
- ifname
is eithernull
or empty.
-
appVersion
public ApplicationInfo.Builder appVersion(java.lang.String version)
-
copyright
public ApplicationInfo.Builder copyright(@Nullable java.lang.String copyright)
-
description
public ApplicationInfo.Builder description(@Nullable java.lang.String description)
-
attributes
public ApplicationInfo.Builder attributes(@Nullable EField attributes)
-
-