Package org.sonar.plugins.python.indexer
Record Class PackageResolutionResult
java.lang.Object
java.lang.Record
org.sonar.plugins.python.indexer.PackageResolutionResult
- Record Components:
roots- The resolved package root absolute pathsmethod- The method used to resolve the package rootsbuildSystem- The build system identified (only applicable for PYPROJECT_TOML method)
public record PackageResolutionResult(List<String> roots, PackageResolutionResult.ResolutionMethod method, PackageResolutionResult.BuildSystem buildSystem)
extends Record
Result of package root resolution containing both the resolved roots and
information about how they were resolved.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumBuild systems supported in pyproject.toml.static enumHow the package roots were resolved. -
Constructor Summary
ConstructorsConstructorDescriptionPackageResolutionResult(List<String> roots, PackageResolutionResult.ResolutionMethod method, PackageResolutionResult.BuildSystem buildSystem) Creates an instance of aPackageResolutionResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thebuildSystemrecord component.final booleanIndicates whether some other object is "equal to" this one.static PackageResolutionResultfromBaseDir(List<String> roots) static PackageResolutionResultfromBothPyProjectAndSetupPy(List<String> roots, PackageResolutionResult.BuildSystem buildSystem) static PackageResolutionResultfromConventionalFolders(List<String> roots) static PackageResolutionResultstatic PackageResolutionResultfromPyProjectToml(List<String> roots, PackageResolutionResult.BuildSystem buildSystem) static PackageResolutionResultfromSetupPy(List<String> roots) static PackageResolutionResultfromSonarSources(List<String> roots) final inthashCode()Returns a hash code value for this object.method()Returns the value of themethodrecord component.roots()Returns the value of therootsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
PackageResolutionResult
public PackageResolutionResult(List<String> roots, PackageResolutionResult.ResolutionMethod method, PackageResolutionResult.BuildSystem buildSystem) Creates an instance of aPackageResolutionResultrecord class.- Parameters:
roots- the value for therootsrecord componentmethod- the value for themethodrecord componentbuildSystem- the value for thebuildSystemrecord component
-
-
Method Details
-
fromPyProjectToml
public static PackageResolutionResult fromPyProjectToml(List<String> roots, PackageResolutionResult.BuildSystem buildSystem) -
fromSetupPy
-
fromBothPyProjectAndSetupPy
public static PackageResolutionResult fromBothPyProjectAndSetupPy(List<String> roots, PackageResolutionResult.BuildSystem buildSystem) -
fromSonarSources
-
fromConventionalFolders
-
fromBaseDir
-
fromLegacyInitPy
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
roots
Returns the value of therootsrecord component.- Returns:
- the value of the
rootsrecord component
-
method
Returns the value of themethodrecord component.- Returns:
- the value of the
methodrecord component
-
buildSystem
Returns the value of thebuildSystemrecord component.- Returns:
- the value of the
buildSystemrecord component
-