Class ImmutableMavenArtifact

    • Method Detail

      • getGroupId

        public String getGroupId()
        Specified by:
        getGroupId in interface Artifact
        Returns:
        The value of the groupId attribute
      • getArtifactId

        public String getArtifactId()
        Specified by:
        getArtifactId in interface Artifact
        Returns:
        The value of the artifactId attribute
      • withGroupId

        public final ImmutableMavenArtifact withGroupId​(String value)
        Copy the current immutable object by setting a value for the groupId attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for groupId
        Returns:
        A modified copy of the this object
      • withArtifactId

        public final ImmutableMavenArtifact withArtifactId​(String value)
        Copy the current immutable object by setting a value for the artifactId attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for artifactId
        Returns:
        A modified copy of the this object
      • withVersion

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

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

        public boolean equals​(Object another)
        This instance is equal to all instances of ImmutableMavenArtifact 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: groupId, artifactId, version.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • toString

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

        public static ImmutableMavenArtifact copyOf​(MavenArtifact instance)
        Creates an immutable copy of a MavenArtifact 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 MavenArtifact instance