Class ImmutablePullRequestCreate

  • All Implemented Interfaces:
    PullRequestCreate

    @ParametersAreNonnullByDefault
    @Generated("org.immutables.processor.ProxyProcessor")
    @Immutable
    @CheckReturnValue
    public final class ImmutablePullRequestCreate
    extends Object
    implements PullRequestCreate
    Immutable implementation of PullRequestCreate.

    Use the builder to create immutable instances: ImmutablePullRequestCreate.builder().

    • Method Detail

      • head

        @Nullable
        public String head()
        The name of the branch where your changes are implemented. For cross-repository pull requests in the same network, namespace head with a user like this: username:branch.
        Specified by:
        head in interface PullRequestCreate
      • base

        @Nullable
        public String base()
        The name of the branch you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repository that requests a merge to a base of another repository.
        Specified by:
        base in interface PullRequestCreate
      • withTitle

        public final ImmutablePullRequestCreate withTitle​(@Nullable
                                                          String value)
        Copy the current immutable object by setting a value for the title attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for title (can be null)
        Returns:
        A modified copy of the this object
      • withBody

        public final ImmutablePullRequestCreate withBody​(String value)
        Copy the current immutable object by setting a present value for the optional body attribute.
        Parameters:
        value - The value for body
        Returns:
        A modified copy of this object
      • withBody

        public final ImmutablePullRequestCreate withBody​(Optional<String> optional)
        Copy the current immutable object by setting an optional value for the body attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
        Parameters:
        optional - A value for body
        Returns:
        A modified copy of this object
      • withHead

        public final ImmutablePullRequestCreate withHead​(@Nullable
                                                         String value)
        Copy the current immutable object by setting a value for the head attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for head (can be null)
        Returns:
        A modified copy of the this object
      • withBase

        public final ImmutablePullRequestCreate withBase​(@Nullable
                                                         String value)
        Copy the current immutable object by setting a value for the base attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for base (can be null)
        Returns:
        A modified copy of the this object
      • equals

        public boolean equals​(@Nullable
                              Object another)
        This instance is equal to all instances of ImmutablePullRequestCreate that have equal attribute values.
        Overrides:
        equals in class Object
        Returns:
        true if this is equal to another instance
      • hashCode

        public int hashCode()
        Computes a hash code from attributes: title, body, head, base.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • toString

        public String toString()
        Prints the immutable value PullRequestCreate with attribute values.
        Overrides:
        toString in class Object
        Returns:
        A string representation of the value
      • copyOf

        public static ImmutablePullRequestCreate copyOf​(PullRequestCreate instance)
        Creates an immutable copy of a PullRequestCreate value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
        Parameters:
        instance - The instance to copy
        Returns:
        A copied immutable PullRequestCreate instance