Package io.riada.insight.model
Class ImmutableInsightUser.Builder
java.lang.Object
io.riada.insight.model.ImmutableInsightUser.Builder
- Enclosing class:
- ImmutableInsightUser
Builds instances of type
ImmutableInsightUser
.
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 newImmutableInsightUser
.from
(InsightUser instance) Fill a builder with attribute values from the providedInsightUser
instance.setDisplayName
(String displayName) Initializes the value for thedisplayName
attribute.setEmailAddress
(String emailAddress) Initializes the value for theemailAddress
attribute.setExternalId
(String externalId) Initializes the value for theexternalId
attribute.setInsightRoles
(Collection<InsightRole> insightRoles) Initializes the value for theinsightRoles
attribute.Initializes the value for thekey
attribute.setLastSeenVersion
(String lastSeenVersion) Initializes the value for thelastSeenVersion
attribute.Initializes the value for thename
attribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedInsightUser
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
-
setKey
Initializes the value for thekey
attribute.- Parameters:
key
- The value for key- Returns:
this
builder for use in a chained invocation
-
setName
Initializes the value for thename
attribute.- Parameters:
name
- The value for name (can benull
)- Returns:
this
builder for use in a chained invocation
-
setDisplayName
@CanIgnoreReturnValue public final ImmutableInsightUser.Builder setDisplayName(@Nullable String displayName) Initializes the value for thedisplayName
attribute.- Parameters:
displayName
- The value for displayName (can benull
)- Returns:
this
builder for use in a chained invocation
-
setEmailAddress
@CanIgnoreReturnValue public final ImmutableInsightUser.Builder setEmailAddress(@Nullable String emailAddress) Initializes the value for theemailAddress
attribute.- Parameters:
emailAddress
- The value for emailAddress (can benull
)- Returns:
this
builder for use in a chained invocation
-
setLastSeenVersion
@CanIgnoreReturnValue public final ImmutableInsightUser.Builder setLastSeenVersion(@Nullable String lastSeenVersion) Initializes the value for thelastSeenVersion
attribute.- Parameters:
lastSeenVersion
- The value for lastSeenVersion (can benull
)- Returns:
this
builder for use in a chained invocation
-
setExternalId
@CanIgnoreReturnValue public final ImmutableInsightUser.Builder setExternalId(@Nullable String externalId) Initializes the value for theexternalId
attribute.- Parameters:
externalId
- The value for externalId (can benull
)- Returns:
this
builder for use in a chained invocation
-
setInsightRoles
@CanIgnoreReturnValue public final ImmutableInsightUser.Builder setInsightRoles(@Nullable Collection<InsightRole> insightRoles) Initializes the value for theinsightRoles
attribute.- Parameters:
insightRoles
- The value for insightRoles (can benull
)- Returns:
this
builder for use in a chained invocation
-
build
Builds a newImmutableInsightUser
.- Returns:
- An immutable instance of InsightUser
- Throws:
IllegalStateException
- if any required attributes are missing
-