Class ImmutableCommit.Builder

  • Enclosing class:
    ImmutableCommit

    @NotThreadSafe
    public static final class ImmutableCommit.Builder
    extends Object
    Builds instances of type ImmutableCommit. 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 ImmutableCommit.Builder from​(Commit instance)
        Fill a builder with attribute values from the provided Commit 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
      • sha

        @CanIgnoreReturnValue
        public final ImmutableCommit.Builder sha​(String sha)
        Initializes the optional value sha to sha.
        Parameters:
        sha - The value for sha
        Returns:
        this builder for chained invocation
      • sha

        @CanIgnoreReturnValue
        public final ImmutableCommit.Builder sha​(Optional<String> sha)
        Initializes the optional value sha to sha.
        Parameters:
        sha - The value for sha
        Returns:
        this builder for use in a chained invocation
      • url

        @CanIgnoreReturnValue
        public final ImmutableCommit.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
      • author

        @CanIgnoreReturnValue
        public final ImmutableCommit.Builder author​(@Nullable
                                                    Author author)
        Initializes the value for the author attribute.
        Parameters:
        author - The value for author (can be null)
        Returns:
        this builder for use in a chained invocation
      • committer

        @CanIgnoreReturnValue
        public final ImmutableCommit.Builder committer​(@Nullable
                                                       Author committer)
        Initializes the value for the committer attribute.
        Parameters:
        committer - The value for committer (can be null)
        Returns:
        this builder for use in a chained invocation
      • message

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

        @CanIgnoreReturnValue
        public final ImmutableCommit.Builder tree​(@Nullable
                                                  ShaLink tree)
        Initializes the value for the tree attribute.
        Parameters:
        tree - The value for tree (can be null)
        Returns:
        this builder for use in a chained invocation
      • commentCount

        @CanIgnoreReturnValue
        public final ImmutableCommit.Builder commentCount​(int commentCount)
        Initializes the optional value commentCount to commentCount.
        Parameters:
        commentCount - The value for commentCount
        Returns:
        this builder for chained invocation
      • commentCount

        @CanIgnoreReturnValue
        public final ImmutableCommit.Builder commentCount​(Optional<Integer> commentCount)
        Initializes the optional value commentCount to commentCount.
        Parameters:
        commentCount - The value for commentCount
        Returns:
        this builder for use in a chained invocation