Class ImmutableTag

  • All Implemented Interfaces:
    ShaLink, Tag

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

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

    • Method Detail

      • sha

        @Nullable
        public String sha()
        SHA.
        Specified by:
        sha in interface ShaLink
      • url

        @Nullable
        public URI url()
        URL.
        Specified by:
        url in interface ShaLink
      • tag

        @Nullable
        public String tag()
        The tag.
        Specified by:
        tag in interface Tag
      • message

        @Nullable
        public String message()
        The tag message.
        Specified by:
        message in interface Tag
      • tagger

        @Nullable
        public Author tagger()
        An object with information about the individual creating the tag.
        Specified by:
        tagger in interface Tag
      • object

        @Nullable
        public ReferenceObject object()
        The SHA of the git object this is tagging.
        Specified by:
        object in interface Tag
      • withSha

        public final ImmutableTag 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
      • withUrl

        public final ImmutableTag withUrl​(@Nullable
                                          URI value)
        Copy the current immutable object by setting a value for the url attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for url (can be null)
        Returns:
        A modified copy of the this object
      • withTag

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

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

        public final ImmutableTag withTagger​(@Nullable
                                             Author value)
        Copy the current immutable object by setting a value for the tagger attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for tagger (can be null)
        Returns:
        A modified copy of the this object
      • withObject

        public final ImmutableTag withObject​(@Nullable
                                             ReferenceObject value)
        Copy the current immutable object by setting a value for the object attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for object (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 ImmutableTag 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: sha, url, tag, message, tagger, object.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • toString

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

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

        public static ImmutableTag.Builder builder()
        Creates a builder for ImmutableTag.
         ImmutableTag.builder()
            .sha(String | null) // nullable sha
            .url(java.net.URI | null) // nullable url
            .tag(String | null) // nullable tag
            .message(String | null) // nullable message
            .tagger(com.spotify.github.v3.git.Author | null) // nullable tagger
            .object(com.spotify.github.v3.git.ReferenceObject | null) // nullable object
            .build();
         
        Returns:
        A new ImmutableTag builder