diff options
Diffstat (limited to 'juick-spring-www/src/main/java/com/juick/www/settings')
-rw-r--r-- | juick-spring-www/src/main/java/com/juick/www/settings/TemplateSettingsHolder.java | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/juick-spring-www/src/main/java/com/juick/www/settings/TemplateSettingsHolder.java b/juick-spring-www/src/main/java/com/juick/www/settings/TemplateSettingsHolder.java new file mode 100644 index 00000000..c6df73da --- /dev/null +++ b/juick-spring-www/src/main/java/com/juick/www/settings/TemplateSettingsHolder.java @@ -0,0 +1,35 @@ +package com.juick.www.settings; + +import org.apache.commons.lang3.BooleanUtils; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.springframework.core.env.Environment; + +/** + * Created by aalexeev on 11/22/16. + */ +public class TemplateSettingsHolder { + private final boolean showSponsors; + private final boolean showSape; + + + public TemplateSettingsHolder(Environment settingsEnv) { + showSponsors = BooleanUtils.toBoolean(settingsEnv.getProperty("template.showSponsors", "false")); + showSape = BooleanUtils.toBoolean(settingsEnv.getProperty("template.showSape", "true")); + } + + @Override + public String toString() { + return new ToStringBuilder(this) + .append("showSponsors", showSponsors) + .append("showSape", showSape) + .toString(); + } + + public boolean isShowSponsors() { + return showSponsors; + } + + public boolean isShowSape() { + return showSape; + } +} |