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 providedInsightUserinstance.setDisplayName(String displayName) Initializes the value for thedisplayNameattribute.setEmailAddress(String emailAddress) Initializes the value for theemailAddressattribute.setExternalId(String externalId) Initializes the value for theexternalIdattribute.setInsightRoles(Collection<InsightRole> insightRoles) Initializes the value for theinsightRolesattribute.Initializes the value for thekeyattribute.setLastSeenVersion(String lastSeenVersion) Initializes the value for thelastSeenVersionattribute.Initializes the value for thenameattribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedInsightUserinstance. 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:
thisbuilder for use in a chained invocation
-
setKey
Initializes the value for thekeyattribute.- Parameters:
key- The value for key- Returns:
thisbuilder for use in a chained invocation
-
setName
Initializes the value for thenameattribute.- Parameters:
name- The value for name (can benull)- Returns:
thisbuilder for use in a chained invocation
-
setDisplayName
@CanIgnoreReturnValue public final ImmutableInsightUser.Builder setDisplayName(@Nullable String displayName) Initializes the value for thedisplayNameattribute.- Parameters:
displayName- The value for displayName (can benull)- Returns:
thisbuilder for use in a chained invocation
-
setEmailAddress
@CanIgnoreReturnValue public final ImmutableInsightUser.Builder setEmailAddress(@Nullable String emailAddress) Initializes the value for theemailAddressattribute.- Parameters:
emailAddress- The value for emailAddress (can benull)- Returns:
thisbuilder for use in a chained invocation
-
setLastSeenVersion
@CanIgnoreReturnValue public final ImmutableInsightUser.Builder setLastSeenVersion(@Nullable String lastSeenVersion) Initializes the value for thelastSeenVersionattribute.- Parameters:
lastSeenVersion- The value for lastSeenVersion (can benull)- Returns:
thisbuilder for use in a chained invocation
-
setExternalId
@CanIgnoreReturnValue public final ImmutableInsightUser.Builder setExternalId(@Nullable String externalId) Initializes the value for theexternalIdattribute.- Parameters:
externalId- The value for externalId (can benull)- Returns:
thisbuilder for use in a chained invocation
-
setInsightRoles
@CanIgnoreReturnValue public final ImmutableInsightUser.Builder setInsightRoles(@Nullable Collection<InsightRole> insightRoles) Initializes the value for theinsightRolesattribute.- Parameters:
insightRoles- The value for insightRoles (can benull)- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableInsightUser.- Returns:
- An immutable instance of InsightUser
- Throws:
IllegalStateException- if any required attributes are missing
-