Class ImmutableTeam.Builder

  • Enclosing class:
    ImmutableTeam

    @NotThreadSafe
    public static final class ImmutableTeam.Builder
    extends Object
    Builds instances of type ImmutableTeam. 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.

    • Constructor Detail

      • Builder

        public Builder()
        Creates a builder for ImmutableTeam instances.
    • Method Detail

      • from

        public final ImmutableTeam.Builder from​(Team instance)
        Fill a builder with attribute values from the provided Team instance. 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:
        this builder for use in a chained invocation
      • id

        public final ImmutableTeam.Builder id​(@Nullable
                                              String id)
        Initializes the value for the id attribute.
        Parameters:
        id - The value for id (can be null)
        Returns:
        this builder for use in a chained invocation
      • members

        public final ImmutableTeam.Builder members​(Member... members)
        Initializes the value for the members attribute.
        Parameters:
        members - The elements for members
        Returns:
        this builder for use in a chained invocation
      • putTags

        public final ImmutableTeam.Builder putTags​(String key,
                                                   String value)
        Put one entry to the tags map.
        Parameters:
        key - The key in the tags map
        value - The associated value in the tags map
        Returns:
        this builder for use in a chained invocation
      • putTags

        public final ImmutableTeam.Builder putTags​(Map.Entry<String,​? extends String> entry)
        Put one entry to the tags map. Nulls are not permitted
        Parameters:
        entry - The key and value entry
        Returns:
        this builder 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 the tags map. 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:
        this builder 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 to tags map. Nulls are not permitted
        Parameters:
        tags - The entries that will be added to the tags map
        Returns:
        this builder for use in a chained invocation