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 classImmutableMavenArtifact.BuilderBuilds instances of typeImmutableMavenArtifact.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableMavenArtifactcopyOf(MavenArtifact instance)Creates an immutable copy of aMavenArtifactvalue.booleanequals(Object another)This instance is equal to all instances ofImmutableMavenArtifactthat have equal attribute values.StringgetArtifactId()StringgetGroupId()Optional<String>getVersion()inthashCode()Computes a hash code from attributes:groupId,artifactId,version.StringtoString()Prints the immutable valueMavenArtifactwith attribute values.ImmutableMavenArtifactwithArtifactId(String value)Copy the current immutable object by setting a value for theartifactIdattribute.ImmutableMavenArtifactwithGroupId(String value)Copy the current immutable object by setting a value for thegroupIdattribute.ImmutableMavenArtifactwithVersion(String value)Copy the current immutable object by setting a present value for the optionalversionattribute.ImmutableMavenArtifactwithVersion(Optional<String> optional)Copy the current immutable object by setting an optional value for theversionattribute.
-
-
-
Method Detail
-
getGroupId
public String getGroupId()
- Specified by:
getGroupIdin interfaceArtifact- Returns:
- The value of the
groupIdattribute
-
getArtifactId
public String getArtifactId()
- Specified by:
getArtifactIdin interfaceArtifact- Returns:
- The value of the
artifactIdattribute
-
getVersion
public Optional<String> getVersion()
- Specified by:
getVersionin interfaceArtifact- Returns:
- The value of the
versionattribute
-
withGroupId
public final ImmutableMavenArtifact withGroupId(String value)
Copy the current immutable object by setting a value for thegroupIdattribute. 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
thisobject
-
withArtifactId
public final ImmutableMavenArtifact withArtifactId(String value)
Copy the current immutable object by setting a value for theartifactIdattribute. 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
thisobject
-
withVersion
public final ImmutableMavenArtifact withVersion(String value)
Copy the current immutable object by setting a present value for the optionalversionattribute.- Parameters:
value- The value for version- Returns:
- A modified copy of
thisobject
-
withVersion
public final ImmutableMavenArtifact withVersion(Optional<String> optional)
Copy the current immutable object by setting an optional value for theversionattribute. 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
thisobject
-
equals
public boolean equals(Object another)
This instance is equal to all instances ofImmutableMavenArtifactthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:groupId,artifactId,version.
-
toString
public String toString()
Prints the immutable valueMavenArtifactwith attribute values.
-
copyOf
public static ImmutableMavenArtifact copyOf(MavenArtifact instance)
Creates an immutable copy of aMavenArtifactvalue. 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
-
-