001    /**
002     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.kernel.util;
016    
017    import java.util.Properties;
018    
019    import javax.portlet.PortletPreferences;
020    
021    /**
022     * @author Brian Wing Shun Chan
023     */
024    public interface PrefsProps {
025    
026            public boolean getBoolean(long companyId, String name);
027    
028            public boolean getBoolean(
029                    long companyId, String name, boolean defaultValue);
030    
031            public boolean getBoolean(
032                    PortletPreferences preferences, long companyId, String name);
033    
034            public boolean getBoolean(
035                    PortletPreferences preferences, long companyId, String name,
036                    boolean defaultValue);
037    
038            public boolean getBoolean(String name);
039    
040            public boolean getBoolean(String name, boolean defaultValue);
041    
042            public String getContent(long companyId, String name);
043    
044            public String getContent(
045                    PortletPreferences preferences, long companyId, String name);
046    
047            public String getContent(String name);
048    
049            public double getDouble(long companyId, String name);
050    
051            public double getDouble(long companyId, String name, double defaultValue);
052    
053            public double getDouble(
054                    PortletPreferences preferences, long companyId, String name);
055    
056            public double getDouble(
057                    PortletPreferences preferences, long companyId, String name,
058                    double defaultValue);
059    
060            public double getDouble(String name);
061    
062            public double getDouble(String name, double defaultValue);
063    
064            public int getInteger(long companyId, String name);
065    
066            public int getInteger(long companyId, String name, int defaultValue);
067    
068            public int getInteger(
069                    PortletPreferences preferences, long companyId, String name);
070    
071            public int getInteger(
072                    PortletPreferences preferences, long companyId, String name,
073                    int defaultValue);
074    
075            public int getInteger(String name);
076    
077            public int getInteger(String name, int defaultValue);
078    
079            public long getLong(long companyId, String name);
080    
081            public long getLong(long companyId, String name, long defaultValue);
082    
083            public long getLong(
084                    PortletPreferences preferences, long companyId, String name);
085    
086            public long getLong(
087                    PortletPreferences preferences, long companyId, String name,
088                    long defaultValue);
089    
090            public long getLong(String name);
091    
092            public long getLong(String name, long defaultValue);
093    
094            public PortletPreferences getPreferences();
095    
096            public PortletPreferences getPreferences(boolean readOnly);
097    
098            public PortletPreferences getPreferences(long companyId);
099    
100            public PortletPreferences getPreferences(long companyId, boolean readOnly);
101    
102            public Properties getProperties(
103                    PortletPreferences preferences, long companyId, String prefix,
104                    boolean removePrefix);
105    
106            public Properties getProperties(String prefix, boolean removePrefix);
107    
108            public short getShort(long companyId, String name);
109    
110            public short getShort(long companyId, String name, short defaultValue);
111    
112            public short getShort(
113                    PortletPreferences preferences, long companyId, String name);
114    
115            public short getShort(
116                    PortletPreferences preferences, long companyId, String name,
117                    short defaultValue);
118    
119            public short getShort(String name);
120    
121            public short getShort(String name, short defaultValue);
122    
123            public String getString(long companyId, String name);
124    
125            public String getString(long companyId, String name, String defaultValue);
126    
127            public String getString(
128                    PortletPreferences preferences, long companyId, String name);
129    
130            public String getString(
131                    PortletPreferences preferences, long companyId, String name,
132                    boolean defaultValue);
133    
134            public String getString(
135                    PortletPreferences preferences, long companyId, String name,
136                    double defaultValue);
137    
138            public String getString(
139                    PortletPreferences preferences, long companyId, String name,
140                    int defaultValue);
141    
142            public String getString(
143                    PortletPreferences preferences, long companyId, String name,
144                    long defaultValue);
145    
146            public String getString(
147                    PortletPreferences preferences, long companyId, String name,
148                    short defaultValue);
149    
150            public String getString(
151                    PortletPreferences preferences, long companyId, String name,
152                    String defaultValue);
153    
154            public String getString(String name);
155    
156            public String getString(String name, String defaultValue);
157    
158            public String[] getStringArray(
159                    long companyId, String name, String delimiter);
160    
161            public String[] getStringArray(
162                    long companyId, String name, String delimiter, String[] defaultValue);
163    
164            public String[] getStringArray(
165                    PortletPreferences preferences, long companyId, String name,
166                    String delimiter);
167    
168            public String[] getStringArray(
169                    PortletPreferences preferences, long companyId, String name,
170                    String delimiter, String[] defaultValue);
171    
172            public String[] getStringArray(String name, String delimiter);
173    
174            public String[] getStringArray(
175                    String name, String delimiter, String[] defaultValue);
176    
177            public String getStringFromNames(long companyId, String... names);
178    
179    }