public class UtilityClassWithPublicConstructor
A class which only contains utility variables and functions with no concrete implementation can be refactored
into an object
or an class with a non-public constructor.
Furthermore, this rule reports utility classes which are not final.
// public constructor here
constructor() {
// ...
}
companion object {
val i = 0
}
}
open class UtilityClassViolation private constructor() {
// ...
}
private constructor() {
// ...
}
companion object {
val i = 0
}
} object UtilityClass {
val i = 0
}
Constructor and Description |
---|
UtilityClassWithPublicConstructor(io.gitlab.arturbosch.detekt.api.Config config)
A class which only contains utility variables and functions with no concrete implementation can be refactored
into an
object or an class with a non-public constructor.
Furthermore, this rule reports utility classes which are not final. |
UtilityClassWithPublicConstructor()
A class which only contains utility variables and functions with no concrete implementation can be refactored
into an
object or an class with a non-public constructor.
Furthermore, this rule reports utility classes which are not final. |
Modifier and Type | Method and Description |
---|---|
io.gitlab.arturbosch.detekt.api.Issue |
getIssue() |
void |
visitClass(org.jetbrains.kotlin.psi.KtClass klass) |
public UtilityClassWithPublicConstructor(io.gitlab.arturbosch.detekt.api.Config config)
A class which only contains utility variables and functions with no concrete implementation can be refactored
into an object
or an class with a non-public constructor.
Furthermore, this rule reports utility classes which are not final.
// public constructor here
constructor() {
// ...
}
companion object {
val i = 0
}
}
open class UtilityClassViolation private constructor() {
// ...
}
private constructor() {
// ...
}
companion object {
val i = 0
}
} object UtilityClass {
val i = 0
}
public UtilityClassWithPublicConstructor()
A class which only contains utility variables and functions with no concrete implementation can be refactored
into an object
or an class with a non-public constructor.
Furthermore, this rule reports utility classes which are not final.
// public constructor here
constructor() {
// ...
}
companion object {
val i = 0
}
}
open class UtilityClassViolation private constructor() {
// ...
}
private constructor() {
// ...
}
companion object {
val i = 0
}
} object UtilityClass {
val i = 0
}