Add EngineConfiguration#getSetting()
This commit is contained in:
parent
db408d796d
commit
56d273aa39
1 changed files with 38 additions and 0 deletions
|
@ -25,6 +25,8 @@ import de.staropensource.sosengine.base.types.LogIssuer;
|
||||||
import de.staropensource.sosengine.base.types.LogLevel;
|
import de.staropensource.sosengine.base.types.LogLevel;
|
||||||
import de.staropensource.sosengine.base.utility.PropertyParser;
|
import de.staropensource.sosengine.base.utility.PropertyParser;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
|
||||||
|
@ -265,4 +267,40 @@ public class EngineConfiguration {
|
||||||
loggerImmediateShutdown = false;
|
loggerImmediateShutdown = false;
|
||||||
loggerForceStandardOutput = 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue