diff options
author | Thomas <> | 2023-06-27 07:05:11 +0200 |
---|---|---|
committer | Thomas <> | 2023-06-27 07:05:11 +0200 |
commit | 1a46583236b58a77b11abc91681f697c4cb7e46e (patch) | |
tree | 7654b0564151b9e566dcdbe90ba35c7a8e77494e /pdf-as-lib | |
parent | 8c0dbe2fe66df35108c0d5ef137465779d55ad11 (diff) | |
download | pdf-as-4-1a46583236b58a77b11abc91681f697c4cb7e46e.tar.gz pdf-as-4-1a46583236b58a77b11abc91681f697c4cb7e46e.tar.bz2 pdf-as-4-1a46583236b58a77b11abc91681f697c4cb7e46e.zip |
chore(core): add methods to get boolean configuration-values into configuration class
Diffstat (limited to 'pdf-as-lib')
-rw-r--r-- | pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/settings/Settings.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/settings/Settings.java b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/settings/Settings.java index 0b376455..8138f061 100644 --- a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/settings/Settings.java +++ b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/settings/Settings.java @@ -40,6 +40,7 @@ import java.util.stream.Collectors; import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOCase; import org.apache.commons.io.filefilter.WildcardFileFilter; +import org.apache.commons.lang3.StringUtils; import at.gv.egiz.pdfas.common.exceptions.PdfAsSettingsException; import at.gv.egiz.pdfas.common.settings.IProfileConstants; @@ -322,6 +323,21 @@ public class Settings implements ISettings, IProfileConstants { return properties.getProperty(key); } + public boolean isValue(String key) { + return isValue(key, false); + + } + public boolean isValue(String key, boolean defaultValue) { + String value = getValue(key); + if (StringUtils.isNotEmpty(value)) { + return Boolean.valueOf(value); + + } else { + return defaultValue; + + } + } + @Override public boolean hasValue(String key) { return properties.containsKey(key); |