Class ImmutableTree.Builder

  • Enclosing class:
    ImmutableTree

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

      • from

        @CanIgnoreReturnValue
        public final ImmutableTree.Builder from​(Tree instance)
        Fill a builder with attribute values from the provided com.spotify.github.v3.git.Tree instance.
        Parameters:
        instance - The instance from which to copy values
        Returns:
        this builder for use in a chained invocation
      • from

        @CanIgnoreReturnValue
        public final ImmutableTree.Builder from​(ShaLink instance)
        Fill a builder with attribute values from the provided com.spotify.github.v3.git.ShaLink instance.
        Parameters:
        instance - The instance from which to copy values
        Returns:
        this builder for use in a chained invocation
      • sha

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

        @CanIgnoreReturnValue
        public final ImmutableTree.Builder url​(@Nullable
                                               URI url)
        Initializes the value for the url attribute.
        Parameters:
        url - The value for url (can be null)
        Returns:
        this builder for use in a chained invocation
      • addTree

        @CanIgnoreReturnValue
        public final ImmutableTree.Builder addTree​(TreeItem element)
        Adds one element to tree list.
        Parameters:
        element - A tree element
        Returns:
        this builder for use in a chained invocation
      • addTree

        @CanIgnoreReturnValue
        public final ImmutableTree.Builder addTree​(TreeItem... elements)
        Adds elements to tree list.
        Parameters:
        elements - An array of tree elements
        Returns:
        this builder for use in a chained invocation
      • tree

        @CanIgnoreReturnValue
        public final ImmutableTree.Builder tree​(@Nullable
                                                Iterable<? extends TreeItem> elements)
        Sets or replaces all elements for tree list.
        Parameters:
        elements - An iterable of tree elements
        Returns:
        this builder for use in a chained invocation
      • addAllTree

        @CanIgnoreReturnValue
        public final ImmutableTree.Builder addAllTree​(Iterable<? extends TreeItem> elements)
        Adds elements to tree list.
        Parameters:
        elements - An iterable of tree elements
        Returns:
        this builder for use in a chained invocation
      • truncated

        @CanIgnoreReturnValue
        public final ImmutableTree.Builder truncated​(@Nullable
                                                     Boolean truncated)
        Initializes the value for the truncated attribute.
        Parameters:
        truncated - The value for truncated (can be null)
        Returns:
        this builder for use in a chained invocation