Package org.openrewrite.maven.tree
Class Pom.Dependency
- java.lang.Object
-
- org.openrewrite.maven.tree.Pom.Dependency
-
- All Implemented Interfaces:
DependencyDescriptor
- Enclosing class:
- Pom
public static class Pom.Dependency extends java.lang.Object implements DependencyDescriptor
-
-
Constructor Summary
Constructors Constructor Description Dependency()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Collection<Pom.Dependency>findDependencies(java.lang.String groupId, java.lang.String artifactId)Finds transitive dependencies of this dependency that match the provided group and artifact ids.java.util.Collection<Pom.Dependency>findDependencies(java.util.function.Predicate<Pom.Dependency> matcher)Finds transitive dependencies of this dependency that match the given predicate.java.lang.StringgetArtifactId()java.net.URIgetArtifactUri()java.lang.StringgetCoordinates()java.lang.StringgetGroupId()java.lang.StringgetVersion()java.lang.StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.openrewrite.maven.tree.DependencyDescriptor
getClassifier, getExclusions, getScope
-
-
-
-
Method Detail
-
getGroupId
public java.lang.String getGroupId()
- Specified by:
getGroupIdin interfaceDependencyDescriptor
-
getArtifactId
public java.lang.String getArtifactId()
- Specified by:
getArtifactIdin interfaceDependencyDescriptor
-
getVersion
public java.lang.String getVersion()
- Specified by:
getVersionin interfaceDependencyDescriptor
-
getArtifactUri
public java.net.URI getArtifactUri()
-
getCoordinates
public java.lang.String getCoordinates()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
findDependencies
public java.util.Collection<Pom.Dependency> findDependencies(java.lang.String groupId, java.lang.String artifactId)
Finds transitive dependencies of this dependency that match the provided group and artifact ids.- Parameters:
groupId- The groupId to matchartifactId- The artifactId to match.- Returns:
- Transitive dependencies with any version matching the provided group and artifact id, if any.
-
findDependencies
public java.util.Collection<Pom.Dependency> findDependencies(java.util.function.Predicate<Pom.Dependency> matcher)
Finds transitive dependencies of this dependency that match the given predicate.- Parameters:
matcher- A dependency test.- Returns:
- Transitive dependencies with any version matching the given predicate.
-
-