diff --git a/base/src/main/java/de/staropensource/sosengine/base/EngineConfiguration.java b/base/src/main/java/de/staropensource/sosengine/base/EngineConfiguration.java index 37c4a66..6c0f36b 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/EngineConfiguration.java +++ b/base/src/main/java/de/staropensource/sosengine/base/EngineConfiguration.java @@ -25,6 +25,8 @@ import de.staropensource.sosengine.base.types.LogIssuer; import de.staropensource.sosengine.base.types.LogLevel; import de.staropensource.sosengine.base.utility.PropertyParser; import lombok.Getter; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import java.util.Properties; @@ -265,4 +267,40 @@ public class EngineConfiguration { loggerImmediateShutdown = false; loggerForceStandardOutput = false; } + + /** + * Returns a configuration setting. + * + * @param setting the setting name + * @return the setting's value or {@code null} if not found + */ + @Nullable + public Object getSetting(@NotNull String setting) { + switch (setting) { + case "debug" -> { + return debug; + } + case "debugShortcodeConverter" -> { + return debugShortcodeConverter; + } + case "errorShortcodeConverter" -> { + return errorShortcodeConverter; + } + case "loggerLevel" -> { + return loggerLevel; + } + case "loggerTemplate" -> { + return loggerTemplate; + } + case "loggerImmediateShutdown" -> { + return loggerImmediateShutdown; + } + case "loggerForceStandardOutput" -> { + return loggerForceStandardOutput; + } + default -> { + return null; + } + } + } }