Package com.telenordigital.nbiot
Class ImmutableTeam.Builder
- java.lang.Object
-
- com.telenordigital.nbiot.ImmutableTeam.Builder
-
- Enclosing class:
- ImmutableTeam
@NotThreadSafe public static final class ImmutableTeam.Builder extends Object
Builds instances of typeImmutableTeam. Initialize attributes and then invoke thebuild()method to create an immutable instance.Builderis not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.
-
-
Constructor Summary
Constructors Constructor Description Builder()Creates a builder forImmutableTeaminstances.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImmutableTeambuild()Builds a newImmutableTeam.ImmutableTeam.Builderfrom(Team instance)Fill a builder with attribute values from the providedTeaminstance.ImmutableTeam.Builderid(String id)Initializes the value for theidattribute.ImmutableTeam.Buildermembers(Member... members)Initializes the value for themembersattribute.ImmutableTeam.BuilderputAllTags(Map<String,? extends String> tags)Put all mappings from the specified map as entries totagsmap.ImmutableTeam.BuilderputTags(String key, String value)Put one entry to thetagsmap.ImmutableTeam.BuilderputTags(Map.Entry<String,? extends String> entry)Put one entry to thetagsmap.ImmutableTeam.Buildertags(Map<String,? extends String> tags)Sets or replaces all mappings from the specified map as entries for thetagsmap.
-
-
-
Constructor Detail
-
Builder
public Builder()
Creates a builder forImmutableTeaminstances.
-
-
Method Detail
-
from
public final ImmutableTeam.Builder from(Team instance)
Fill a builder with attribute values from the providedTeaminstance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values. Collection elements and entries will be added, not replaced.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
id
public final ImmutableTeam.Builder id(@Nullable String id)
Initializes the value for theidattribute.- Parameters:
id- The value for id (can benull)- Returns:
thisbuilder for use in a chained invocation
-
members
public final ImmutableTeam.Builder members(Member... members)
Initializes the value for themembersattribute.- Parameters:
members- The elements for members- Returns:
thisbuilder for use in a chained invocation
-
putTags
public final ImmutableTeam.Builder putTags(String key, String value)
Put one entry to thetagsmap.- Parameters:
key- The key in the tags mapvalue- The associated value in the tags map- Returns:
thisbuilder for use in a chained invocation
-
putTags
public final ImmutableTeam.Builder putTags(Map.Entry<String,? extends String> entry)
Put one entry to thetagsmap. Nulls are not permitted- Parameters:
entry- The key and value entry- Returns:
thisbuilder for use in a chained invocation
-
tags
public final ImmutableTeam.Builder tags(@Nullable Map<String,? extends String> tags)
Sets or replaces all mappings from the specified map as entries for thetagsmap. Nulls are not permitted as keys or values, but parameter itself can be null- Parameters:
tags- The entries that will be added to the tags map- Returns:
thisbuilder for use in a chained invocation
-
putAllTags
public final ImmutableTeam.Builder putAllTags(Map<String,? extends String> tags)
Put all mappings from the specified map as entries totagsmap. Nulls are not permitted- Parameters:
tags- The entries that will be added to the tags map- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableTeam build()
Builds a newImmutableTeam.- Returns:
- An immutable instance of Team
- Throws:
IllegalStateException- if any required attributes are missing
-
-