Class ImmutablePullRequestRef

  • All Implemented Interfaces:
    PullRequestRef

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

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

    • Method Detail

      • withLabel

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

        public final ImmutablePullRequestRef withLabel​(Optional<String> optional)
        Copy the current immutable object by setting an optional value for the label 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 label
        Returns:
        A modified copy of this object
      • withRef

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

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

        public final ImmutablePullRequestRef withUser​(User value)
        Copy the current immutable object by setting a present value for the optional user attribute.
        Parameters:
        value - The value for user
        Returns:
        A modified copy of this object
      • withUser

        public final ImmutablePullRequestRef withUser​(Optional<? extends User> optional)
        Copy the current immutable object by setting an optional value for the user attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
        Parameters:
        optional - A value for user
        Returns:
        A modified copy of this object
      • withRepo

        public final ImmutablePullRequestRef withRepo​(Repository value)
        Copy the current immutable object by setting a present value for the optional repo attribute.
        Parameters:
        value - The value for repo
        Returns:
        A modified copy of this object
      • withRepo

        public final ImmutablePullRequestRef withRepo​(Optional<? extends Repository> optional)
        Copy the current immutable object by setting an optional value for the repo attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
        Parameters:
        optional - A value for repo
        Returns:
        A modified copy of this object
      • equals

        public boolean equals​(@Nullable
                              Object another)
        This instance is equal to all instances of ImmutablePullRequestRef 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: label, ref, sha, user, repo.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • toString

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

        public static ImmutablePullRequestRef copyOf​(PullRequestRef instance)
        Creates an immutable copy of a PullRequestRef 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 PullRequestRef instance
      • builder

        public static ImmutablePullRequestRef.Builder builder()
        Creates a builder for ImmutablePullRequestRef.
         ImmutablePullRequestRef.builder()
            .label(String) // optional label
            .ref(String | null) // nullable ref
            .sha(String | null) // nullable sha
            .user(com.spotify.github.v3.User) // optional user
            .repo(com.spotify.github.v3.repos.Repository) // optional repo
            .build();
         
        Returns:
        A new ImmutablePullRequestRef builder