aboutsummaryrefslogtreecommitdiff
path: root/juick-spring-www/src/main/java/com/juick/www/settings
diff options
context:
space:
mode:
authorGravatar Alexander Alexeev2016-11-23 16:19:26 +0700
committerGravatar Vitaly Takmazov2016-11-23 13:03:09 +0300
commite7fd58f1023ce9e1c9ab880bf27c5c0b2a3cffca (patch)
tree5ce36019dffc5f6eb4f71756a9f91068d5efbd54 /juick-spring-www/src/main/java/com/juick/www/settings
parent37a171892ba11c578ea947103ee7488801785eac (diff)
thymeleaf layout plugin used
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.java35
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;
+ }
+}