Class ImmutableEvent.Builder

  • Enclosing class:
    ImmutableEvent

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

        @CanIgnoreReturnValue
        public final ImmutableEvent.Builder id​(@Nullable
                                               Integer 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
      • url

        @CanIgnoreReturnValue
        public final ImmutableEvent.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
      • actor

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

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

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

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

        @CanIgnoreReturnValue
        public final ImmutableEvent.Builder createdAt​(@Nullable
                                                      GitHubInstant createdAt)
        Initializes the value for the createdAt attribute.
        Parameters:
        createdAt - The value for createdAt (can be null)
        Returns:
        this builder for use in a chained invocation
      • issue

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

        @CanIgnoreReturnValue
        public final ImmutableEvent.Builder issue​(Optional<? extends Issue> issue)
        Initializes the optional value issue to issue.
        Parameters:
        issue - The value for issue
        Returns:
        this builder for use in a chained invocation