Package org.sonar.plugins.python.indexer
Record Class NamespacePackageTelemetry
java.lang.Object
java.lang.Record
org.sonar.plugins.python.indexer.NamespacePackageTelemetry
- Record Components:
packagesWithInit- The number of packages with an __init__.py file.packagesWithoutInit- The number of packages without an __init__.py file.duplicatePackagesWithoutInit- The number of packages without an __init__.py file that appear multiple times. Each occurrence increments this count.namespacePackagesInRegularPackage- The number of packages without an __init__.py file that have at least one parent with an __init__.py file.resolutionMethod- How the package roots were resolved (e.g., pyproject.toml, setup.py, sonar.sources, fallback).buildSystem- The build system identified when resolution method is PYPROJECT_TOML (e.g., setuptools, poetry).
public record NamespacePackageTelemetry(int packagesWithInit, int packagesWithoutInit, int duplicatePackagesWithoutInit, int namespacePackagesInRegularPackage, @Nullable PackageResolutionResult.ResolutionMethod resolutionMethod, @Nullable PackageResolutionResult.BuildSystem buildSystem)
extends Record
Telemetry data for namespace packages.
-
Constructor Summary
ConstructorsConstructorDescriptionNamespacePackageTelemetry(int packagesWithInit, int packagesWithoutInit, int duplicatePackagesWithoutInit, int namespacePackagesInRegularPackage, PackageResolutionResult.ResolutionMethod resolutionMethod, PackageResolutionResult.BuildSystem buildSystem) Creates an instance of aNamespacePackageTelemetryrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thebuildSystemrecord component.intReturns the value of theduplicatePackagesWithoutInitrecord component.static NamespacePackageTelemetryempty()final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of thenamespacePackagesInRegularPackagerecord component.intReturns the value of thepackagesWithInitrecord component.intReturns the value of thepackagesWithoutInitrecord component.Returns the value of theresolutionMethodrecord component.final StringtoString()Returns a string representation of this record class.withResolutionInfo(PackageResolutionResult.ResolutionMethod method, PackageResolutionResult.BuildSystem system) Creates a new telemetry instance with resolution information added.
-
Constructor Details
-
NamespacePackageTelemetry
public NamespacePackageTelemetry(int packagesWithInit, int packagesWithoutInit, int duplicatePackagesWithoutInit, int namespacePackagesInRegularPackage, @Nullable PackageResolutionResult.ResolutionMethod resolutionMethod, @Nullable PackageResolutionResult.BuildSystem buildSystem) Creates an instance of aNamespacePackageTelemetryrecord class.- Parameters:
packagesWithInit- the value for thepackagesWithInitrecord componentpackagesWithoutInit- the value for thepackagesWithoutInitrecord componentduplicatePackagesWithoutInit- the value for theduplicatePackagesWithoutInitrecord componentnamespacePackagesInRegularPackage- the value for thenamespacePackagesInRegularPackagerecord componentresolutionMethod- the value for theresolutionMethodrecord componentbuildSystem- the value for thebuildSystemrecord component
-
-
Method Details
-
empty
-
withResolutionInfo
public NamespacePackageTelemetry withResolutionInfo(PackageResolutionResult.ResolutionMethod method, PackageResolutionResult.BuildSystem system) Creates a new telemetry instance with resolution information added. -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
packagesWithInit
public int packagesWithInit()Returns the value of thepackagesWithInitrecord component.- Returns:
- the value of the
packagesWithInitrecord component
-
packagesWithoutInit
public int packagesWithoutInit()Returns the value of thepackagesWithoutInitrecord component.- Returns:
- the value of the
packagesWithoutInitrecord component
-
duplicatePackagesWithoutInit
public int duplicatePackagesWithoutInit()Returns the value of theduplicatePackagesWithoutInitrecord component.- Returns:
- the value of the
duplicatePackagesWithoutInitrecord component
-
namespacePackagesInRegularPackage
public int namespacePackagesInRegularPackage()Returns the value of thenamespacePackagesInRegularPackagerecord component.- Returns:
- the value of the
namespacePackagesInRegularPackagerecord component
-
resolutionMethod
Returns the value of theresolutionMethodrecord component.- Returns:
- the value of the
resolutionMethodrecord component
-
buildSystem
Returns the value of thebuildSystemrecord component.- Returns:
- the value of the
buildSystemrecord component
-