PageRenderTime 7ms CodeModel.GetById 1ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/plugin-module-codegen-engine/src/main/java/com/atlassian/plugins/codegen/modules/AbstractPluginModuleProperties.java

https://bitbucket.org/mmeinhold/amps
Java | 70 lines | 55 code | 12 blank | 3 comment | 0 complexity | a14d12d893b9f505953e17144ea1e497 MD5 | raw file
 1package com.atlassian.plugins.codegen.modules;
 2
 3import java.util.HashMap;
 4import java.util.Map;
 5import java.util.Properties;
 6
 7import com.google.common.collect.ImmutableMap;
 8import com.google.common.collect.Maps;
 9
10/**
11 * @since 3.6
12 */
13public abstract class AbstractPluginModuleProperties extends Properties implements PluginModuleProperties
14{
15    protected boolean includeExamples;
16    protected Map<String, String> i18nProperties;
17
18    protected AbstractPluginModuleProperties()
19    {
20        super();
21        i18nProperties = Maps.newHashMap();
22        includeExamples = false;
23        setProductId("RefApp");
24    }
25
26    protected AbstractPluginModuleProperties(AbstractPluginModuleProperties from)
27    {
28        super();
29        putAll(from);
30        i18nProperties = new HashMap(from.i18nProperties);
31        includeExamples = from.includeExamples;
32    }
33
34    @Override
35    public void setProductId(String id)
36    {
37        setProperty(PRODUCT_ID, id);
38    }
39
40    @Override
41    public String getProductId()
42    {
43        return getProperty(PRODUCT_ID);
44    }
45
46    @Override
47    public void setIncludeExamples(boolean includeExamples)
48    {
49        this.includeExamples = includeExamples;
50    }
51
52    @Override
53    public boolean includeExamples()
54    {
55        return includeExamples;
56    }
57
58    @Override
59    public void addI18nProperty(String name, String value)
60    {
61        i18nProperties.put(name, value);
62    }
63
64    @Override
65    public ImmutableMap<String, String> getI18nProperties()
66    {
67        return ImmutableMap.copyOf(i18nProperties);
68    }
69
70}