From 9b5d12203f44b52b471d6c69be176f304b00a1a5 Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Fri, 13 Dec 2024 18:31:17 +0100 Subject: [PATCH] Make private secondary constructors the primaries --- .../kotlin/de/staropensource/engine/base/Engine.kt | 9 +-------- .../de/staropensource/engine/newsubprj/Example.kt | 13 ++++++------- .../de/staropensource/engine/logging/Filterer.kt | 9 +-------- .../engine/logging/LoggerConfiguration.kt | 9 +-------- .../de/staropensource/engine/logging/Processor.kt | 9 +-------- .../kotlin/de/staropensource/engine/testapp/Main.kt | 9 +-------- 6 files changed, 11 insertions(+), 47 deletions(-) diff --git a/base/src/main/kotlin/de/staropensource/engine/base/Engine.kt b/base/src/main/kotlin/de/staropensource/engine/base/Engine.kt index cc1e480..8a4bed3 100644 --- a/base/src/main/kotlin/de/staropensource/engine/base/Engine.kt +++ b/base/src/main/kotlin/de/staropensource/engine/base/Engine.kt @@ -30,7 +30,7 @@ import de.staropensource.engine.logging.Logger * * @since v1-alpha10 */ -class Engine { +class Engine private constructor() { /** * Companion class of [Engine]. * @@ -47,11 +47,4 @@ class Engine { Logger.instance.info("Initializing") } } - - /** - * Initializes this class. - * - * @since v1-alpha10 - */ - private constructor() } diff --git a/dist/template-subproject/src/main/kotlin/de/staropensource/engine/newsubprj/Example.kt b/dist/template-subproject/src/main/kotlin/de/staropensource/engine/newsubprj/Example.kt index 7d2e340..c9b9c61 100644 --- a/dist/template-subproject/src/main/kotlin/de/staropensource/engine/newsubprj/Example.kt +++ b/dist/template-subproject/src/main/kotlin/de/staropensource/engine/newsubprj/Example.kt @@ -20,11 +20,10 @@ package de.staropensource.engine.newsubprj; -class Example { - /** - * Initializes this class. - * - * @since v1-alpha10 - */ - private constructor() +/** + * An example class. + * + * @since v1-alpha10 + */ +class Example private constructor() { } diff --git a/logging/src/main/kotlin/de/staropensource/engine/logging/Filterer.kt b/logging/src/main/kotlin/de/staropensource/engine/logging/Filterer.kt index 6f90d29..c194d00 100644 --- a/logging/src/main/kotlin/de/staropensource/engine/logging/Filterer.kt +++ b/logging/src/main/kotlin/de/staropensource/engine/logging/Filterer.kt @@ -28,7 +28,7 @@ import de.staropensource.engine.logging.type.Call * * @since v1-alpha10 */ -class Filterer { +class Filterer private constructor() { /** * Companion object of [Filterer] * @@ -60,11 +60,4 @@ class Filterer { return false } } - - /** - * Initializes this class. - * - * @since v1-alpha10 - */ - private constructor() } diff --git a/logging/src/main/kotlin/de/staropensource/engine/logging/LoggerConfiguration.kt b/logging/src/main/kotlin/de/staropensource/engine/logging/LoggerConfiguration.kt index 4881fcc..14a5fd2 100644 --- a/logging/src/main/kotlin/de/staropensource/engine/logging/LoggerConfiguration.kt +++ b/logging/src/main/kotlin/de/staropensource/engine/logging/LoggerConfiguration.kt @@ -34,7 +34,7 @@ import kotlin.reflect.KClass * * @since v1-alpha10 */ -class LoggerConfiguration { +class LoggerConfiguration private constructor() { /** * Companion object of [LoggerConfiguration]. * @@ -137,11 +137,4 @@ class LoggerConfiguration { */ var featureDateTimeTZ: TimeZone = TimeZone.currentSystemDefault() } - - /** - * Initializes this class. - * - * @since v1-alpha10 - */ - private constructor() } diff --git a/logging/src/main/kotlin/de/staropensource/engine/logging/Processor.kt b/logging/src/main/kotlin/de/staropensource/engine/logging/Processor.kt index c3050e2..37a79bb 100644 --- a/logging/src/main/kotlin/de/staropensource/engine/logging/Processor.kt +++ b/logging/src/main/kotlin/de/staropensource/engine/logging/Processor.kt @@ -38,14 +38,7 @@ import kotlin.reflect.full.primaryConstructor * * @since v1-alpha10 */ -class Processor { - /** - * Initializes this class. - * - * @since v1-alpha10 - */ - private constructor() - +class Processor private constructor() { /** * Companion object of [Processor]. * diff --git a/testapp/src/main/kotlin/de/staropensource/engine/testapp/Main.kt b/testapp/src/main/kotlin/de/staropensource/engine/testapp/Main.kt index f4140f6..bc499bb 100644 --- a/testapp/src/main/kotlin/de/staropensource/engine/testapp/Main.kt +++ b/testapp/src/main/kotlin/de/staropensource/engine/testapp/Main.kt @@ -28,7 +28,7 @@ import de.staropensource.engine.logging.Logger * * @since v1-alpha10 */ -class Main { +class Main private constructor() { /** * Companion object of [Main]. * @@ -53,11 +53,4 @@ class Main { logger.info("Hello World! Caused by and \\.") } } - - /** - * Initializes this class. - * - * @since v1-alpha10 - */ - private constructor() }