Class ImmutablePushEvent.Builder

  • Enclosing class:
    ImmutablePushEvent

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

        @CanIgnoreReturnValue
        public final ImmutablePushEvent.Builder repository​(@Nullable
                                                           PushRepository repository)
        Initializes the value for the repository attribute.
        Parameters:
        repository - The value for repository (can be null)
        Returns:
        this builder for use in a chained invocation
      • sender

        @CanIgnoreReturnValue
        public final ImmutablePushEvent.Builder sender​(@Nullable
                                                       User sender)
        Initializes the value for the sender attribute.
        Parameters:
        sender - The value for sender (can be null)
        Returns:
        this builder for use in a chained invocation
      • ref

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

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

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

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

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

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

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

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

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

        @CanIgnoreReturnValue
        public final ImmutablePushEvent.Builder addCommits​(PushCommit element)
        Adds one element to commits list.
        Parameters:
        element - A commits element
        Returns:
        this builder for use in a chained invocation
      • addCommits

        @CanIgnoreReturnValue
        public final ImmutablePushEvent.Builder addCommits​(PushCommit... elements)
        Adds elements to commits list.
        Parameters:
        elements - An array of commits elements
        Returns:
        this builder for use in a chained invocation
      • commits

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

        @CanIgnoreReturnValue
        public final ImmutablePushEvent.Builder addAllCommits​(Iterable<? extends PushCommit> elements)
        Adds elements to commits list.
        Parameters:
        elements - An iterable of commits elements
        Returns:
        this builder for use in a chained invocation
      • headCommit

        @CanIgnoreReturnValue
        public final ImmutablePushEvent.Builder headCommit​(@Nullable
                                                           Optional<PushCommit> headCommit)
        Initializes the value for the headCommit attribute.
        Parameters:
        headCommit - The value for headCommit (can be null)
        Returns:
        this builder for use in a chained invocation
      • pusher

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