aboutsummaryrefslogtreecommitdiff
path: root/juick-spring-www/src/main/java/com/juick/www/settings/TemplateSettingsHolder.java
blob: c6df73daafd291de5c31988bcd4579e804360769 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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;
    }
}