Class ImmutableInsightUser.Builder

java.lang.Object
io.riada.insight.model.ImmutableInsightUser.Builder
Enclosing class:
ImmutableInsightUser

@NotThreadSafe public static final class ImmutableInsightUser.Builder extends Object
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 Details

    • from

      @CanIgnoreReturnValue public final ImmutableInsightUser.Builder from(InsightUser instance)
      Fill a builder with attribute values from the provided InsightUser 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

      @CanIgnoreReturnValue public final ImmutableInsightUser.Builder setKey(String key)
      Initializes the value for the key attribute.
      Parameters:
      key - The value for key
      Returns:
      this builder for use in a chained invocation
    • setName

      @CanIgnoreReturnValue public final ImmutableInsightUser.Builder setName(@Nullable String name)
      Initializes the value for the name attribute.
      Parameters:
      name - The value for name (can be null)
      Returns:
      this builder for use in a chained invocation
    • setDisplayName

      @CanIgnoreReturnValue public final ImmutableInsightUser.Builder setDisplayName(@Nullable String displayName)
      Initializes the value for the displayName attribute.
      Parameters:
      displayName - The value for displayName (can be null)
      Returns:
      this builder for use in a chained invocation
    • setEmailAddress

      @CanIgnoreReturnValue public final ImmutableInsightUser.Builder setEmailAddress(@Nullable String emailAddress)
      Initializes the value for the emailAddress attribute.
      Parameters:
      emailAddress - The value for emailAddress (can be null)
      Returns:
      this builder for use in a chained invocation
    • setLastSeenVersion

      @CanIgnoreReturnValue public final ImmutableInsightUser.Builder setLastSeenVersion(@Nullable String lastSeenVersion)
      Initializes the value for the lastSeenVersion attribute.
      Parameters:
      lastSeenVersion - The value for lastSeenVersion (can be null)
      Returns:
      this builder for use in a chained invocation
    • setExternalId

      @CanIgnoreReturnValue public final ImmutableInsightUser.Builder setExternalId(@Nullable String externalId)
      Initializes the value for the externalId attribute.
      Parameters:
      externalId - The value for externalId (can be null)
      Returns:
      this builder for use in a chained invocation
    • setInsightRoles

      @CanIgnoreReturnValue public final ImmutableInsightUser.Builder setInsightRoles(@Nullable Collection<InsightRole> insightRoles)
      Initializes the value for the insightRoles attribute.
      Parameters:
      insightRoles - The value for insightRoles (can be null)
      Returns:
      this builder for use in a chained invocation
    • build

      public ImmutableInsightUser build()
      Builds a new ImmutableInsightUser.
      Returns:
      An immutable instance of InsightUser
      Throws:
      IllegalStateException - if any required attributes are missing