Class ImmutableWatcherBean.Builder
java.lang.Object
com.riadalabs.jira.plugins.insight.services.model.ImmutableWatcherBean.Builder
- Enclosing class:
- ImmutableWatcherBean
Builds instances of type
ImmutableWatcherBean
.
Initialize attributes and then invoke the build()
method to create an
immutable instance.
Builder
is not thread-safe and generally should not be stored in a field or collection,
but instead used immediately to create instances.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds a newImmutableWatcherBean
.from
(WatcherBean instance) Fill a builder with attribute values from the providedWatcherBean
instance.setObjectId
(Integer objectId) Initializes the value for theobjectId
attribute.setUserKey
(String userKey) Initializes the value for theuserKey
attribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedWatcherBean
instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
setObjectId
Initializes the value for theobjectId
attribute.- Parameters:
objectId
- The value for objectId- Returns:
this
builder for use in a chained invocation
-
setUserKey
Initializes the value for theuserKey
attribute.- Parameters:
userKey
- The value for userKey- Returns:
this
builder for use in a chained invocation
-
build
Builds a newImmutableWatcherBean
.- Returns:
- An immutable instance of WatcherBean
- Throws:
IllegalStateException
- if any required attributes are missing
-