Class ImmutableMavenArtifact
- java.lang.Object
-
- org.apache.camel.k.tooling.maven.model.ImmutableMavenArtifact
-
- All Implemented Interfaces:
Artifact
,MavenArtifact
@Generated("org.immutables.processor.ProxyProcessor") public final class ImmutableMavenArtifact extends Object implements MavenArtifact
Immutable implementation ofMavenArtifact
.Use the builder to create immutable instances:
new MavenArtifact.Builder()
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ImmutableMavenArtifact.Builder
Builds instances of typeImmutableMavenArtifact
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableMavenArtifact
copyOf(MavenArtifact instance)
Creates an immutable copy of aMavenArtifact
value.boolean
equals(Object another)
This instance is equal to all instances ofImmutableMavenArtifact
that have equal attribute values.String
getArtifactId()
String
getGroupId()
Optional<String>
getVersion()
int
hashCode()
Computes a hash code from attributes:groupId
,artifactId
,version
.String
toString()
Prints the immutable valueMavenArtifact
with attribute values.ImmutableMavenArtifact
withArtifactId(String value)
Copy the current immutable object by setting a value for theartifactId
attribute.ImmutableMavenArtifact
withGroupId(String value)
Copy the current immutable object by setting a value for thegroupId
attribute.ImmutableMavenArtifact
withVersion(String value)
Copy the current immutable object by setting a present value for the optionalversion
attribute.ImmutableMavenArtifact
withVersion(Optional<String> optional)
Copy the current immutable object by setting an optional value for theversion
attribute.
-
-
-
Method Detail
-
getGroupId
public String getGroupId()
- Specified by:
getGroupId
in interfaceArtifact
- Returns:
- The value of the
groupId
attribute
-
getArtifactId
public String getArtifactId()
- Specified by:
getArtifactId
in interfaceArtifact
- Returns:
- The value of the
artifactId
attribute
-
getVersion
public Optional<String> getVersion()
- Specified by:
getVersion
in interfaceArtifact
- Returns:
- The value of the
version
attribute
-
withGroupId
public final ImmutableMavenArtifact withGroupId(String value)
Copy the current immutable object by setting a value for thegroupId
attribute. An equals check used to prevent copying of the same value by returningthis
.- 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 theartifactId
attribute. An equals check used to prevent copying of the same value by returningthis
.- 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 optionalversion
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 theversion
attribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis
.- 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 ofImmutableMavenArtifact
that have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:groupId
,artifactId
,version
.
-
toString
public String toString()
Prints the immutable valueMavenArtifact
with attribute values.
-
copyOf
public static ImmutableMavenArtifact copyOf(MavenArtifact instance)
Creates an immutable copy of aMavenArtifact
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
-
-