Class ImmutableMavenDependency
java.lang.Object
io.github.ascopes.protobufmavenplugin.dependencies.ImmutableMavenDependency
- All Implemented Interfaces:
MavenArtifact
,MavenDependency
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableMavenDependency
extends Object
implements MavenDependency
Immutable implementation of
MavenDependency
.
Use the builder to create immutable instances:
ImmutableMavenDependency.builder()
.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Builds instances of typeImmutableMavenDependency
. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final String
private final @Nullable String
private final @Nullable DependencyResolutionDepth
private final Set
<MavenExclusionBean> private final String
private final @Nullable String
private final @Nullable String
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Creates a builder forImmutableMavenDependency
.private static <T> List
<T> createSafeList
(Iterable<? extends T> iterable, boolean checkNulls, boolean skipNulls) private static <T> Set
<T> createUnmodifiableSet
(List<T> list) Unmodifiable set constructed from list to avoid rehashing.boolean
This instance is equal to all instances ofImmutableMavenDependency
that have equal attribute values.private boolean
equalTo
(int synthetic, ImmutableMavenDependency another) Get the artifact ID.@Nullable String
Get the artifact classifier.@Nullable DependencyResolutionDepth
Get the preferences for the depth of dependency resolution.Get a set of dependency exclusions to apply when resolving dependencies.Get the group ID.@Nullable String
getType()
Get the artifact type.@Nullable String
Get the artifact version.int
hashCode()
Computes a hash code from attributes:groupId
,artifactId
,version
,type
,classifier
,dependencyResolutionDepth
,exclusions
.toString()
Prints the immutable valueMavenDependency
with attribute values.
-
Field Details
-
groupId
-
artifactId
-
version
-
type
-
classifier
-
dependencyResolutionDepth
-
exclusions
-
-
Constructor Details
-
ImmutableMavenDependency
-
-
Method Details
-
getGroupId
Get the group ID.- Specified by:
getGroupId
in interfaceMavenArtifact
- Returns:
- the group ID.
-
getArtifactId
Get the artifact ID.- Specified by:
getArtifactId
in interfaceMavenArtifact
- Returns:
- the artifact ID.
-
getVersion
Get the artifact version.May be
null
if we expect to discover the version from dependency management.- Specified by:
getVersion
in interfaceMavenArtifact
- Returns:
- the version.
-
getType
Get the artifact type.May be
null
if the default should be used.- Specified by:
getType
in interfaceMavenArtifact
- Returns:
- the artifact type.
-
getClassifier
Get the artifact classifier.May be
null
if no classifier is set.- Specified by:
getClassifier
in interfaceMavenArtifact
- Returns:
- the artifact classifier.
-
getDependencyResolutionDepth
Get the preferences for the depth of dependency resolution.May be
null
if the default should be used.- Specified by:
getDependencyResolutionDepth
in interfaceMavenArtifact
- Returns:
- the preference for the depth of dependency resolution.
-
getExclusions
Get a set of dependency exclusions to apply when resolving dependencies.- Specified by:
getExclusions
in interfaceMavenArtifact
- Returns:
- the exclusions, which by default is empty.
-
equals
-
equalTo
-
hashCode
-
toString
-
builder
Creates a builder forImmutableMavenDependency
.ImmutableMavenDependency.builder() .groupId(String | null) // nullable
groupId
.artifactId(String | null) // nullableartifactId
.version(@org.jspecify.annotations.Nullable String | null) // nullableversion
.type(@org.jspecify.annotations.Nullable String | null) // nullabletype
.classifier(@org.jspecify.annotations.Nullable String | null) // nullableclassifier
.dependencyResolutionDepth(io.github.ascopes.protobufmavenplugin.dependencies.@org.jspecify.annotations.Nullable DependencyResolutionDepth | null) // nullabledependencyResolutionDepth
.addExclusions|addAllExclusions(MavenExclusionBean) //exclusions
elements .build();- Returns:
- A new ImmutableMavenDependency builder
-
createSafeList
-
createUnmodifiableSet
-