com.netflix.nebula.lint.rule.dependency.ClassInformation.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gradle-lint-plugin Show documentation
Show all versions of gradle-lint-plugin Show documentation
Pluggable and configurable linter tool for identifying and reporting on patterns of misuse or deprecations in Gradle scripts
package com.netflix.nebula.lint.rule.dependency
import groovy.transform.CompileStatic
@CompileStatic
class ClassInformation {
String filePath
String source
String name
Collection methodReferences = []
ClassInformation(String source, String name, Collection methodReferences) {
this.source = source
this.name = name
this.methodReferences = methodReferences
this.filePath = calculateFilePath(source, name)
}
@Override
String toString() {
return "source: $source - filePath: $filePath - name: $name - methodReferences: ${methodReferences*.toString().join(' | ')}"
}
private String calculateFilePath(String source, String name) {
String extension = getFileExtension(source)
return name + extension
}
private String getFileExtension(String fileName) {
int lastIndexOf = fileName.lastIndexOf(".")
if (lastIndexOf == -1) {
return ""
}
return fileName.substring(lastIndexOf)
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy