001    /**
002     * Copyright (c) 2000-2013 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 com.liferay.portal.kernel.exception.SystemException;
018    
019    import java.util.Properties;
020    
021    import javax.portlet.PortletPreferences;
022    
023    /**
024     * @author Brian Wing Shun Chan
025     */
026    public interface PrefsProps {
027    
028            public boolean getBoolean(long companyId, String name)
029                    throws SystemException;
030    
031            public boolean getBoolean(long companyId, String name, boolean defaultValue)
032                    throws SystemException;
033    
034            public boolean getBoolean(
035                    PortletPreferences preferences, long companyId, String name);
036    
037            public boolean getBoolean(
038                    PortletPreferences preferences, long companyId, String name,
039                    boolean defaultValue);
040    
041            public boolean getBoolean(String name) throws SystemException;
042    
043            public boolean getBoolean(String name, boolean defaultValue)
044                    throws SystemException;
045    
046            public String getContent(long companyId, String name)
047                    throws SystemException;
048    
049            public String getContent(
050                    PortletPreferences preferences, long companyId, String name);
051    
052            public String getContent(String name) throws SystemException;
053    
054            public double getDouble(long companyId, String name)
055                    throws SystemException;
056    
057            public double getDouble(long companyId, String name, double defaultValue)
058                    throws SystemException;
059    
060            public double getDouble(
061                    PortletPreferences preferences, long companyId, String name);
062    
063            public double getDouble(
064                    PortletPreferences preferences, long companyId, String name,
065                    double defaultValue);
066    
067            public double getDouble(String name) throws SystemException;
068    
069            public double getDouble(String name, double defaultValue)
070                    throws SystemException;
071    
072            public int getInteger(long companyId, String name)
073                    throws SystemException;
074    
075            public int getInteger(long companyId, String name, int defaultValue)
076                    throws SystemException;
077    
078            public int getInteger(
079                    PortletPreferences preferences, long companyId, String name);
080    
081            public int getInteger(
082                    PortletPreferences preferences, long companyId, String name,
083                    int defaultValue);
084    
085            public int getInteger(String name) throws SystemException;
086    
087            public int getInteger(String name, int defaultValue)
088                    throws SystemException;
089    
090            public long getLong(long companyId, String name)
091                    throws SystemException;
092    
093            public long getLong(long companyId, String name, long defaultValue)
094                    throws SystemException;
095    
096            public long getLong(
097                    PortletPreferences preferences, long companyId, String name);
098    
099            public long getLong(
100                    PortletPreferences preferences, long companyId, String name,
101                    long defaultValue);
102    
103            public long getLong(String name) throws SystemException;
104    
105            public long getLong(String name, long defaultValue)
106                    throws SystemException;
107    
108            public PortletPreferences getPreferences() throws SystemException;
109    
110            public PortletPreferences getPreferences(boolean readOnly)
111                    throws SystemException;
112    
113            public PortletPreferences getPreferences(long companyId)
114                    throws SystemException;
115    
116            public PortletPreferences getPreferences(long companyId, boolean readOnly)
117                    throws SystemException;
118    
119            public Properties getProperties(
120                    PortletPreferences preferences, long companyId, String prefix,
121                    boolean removePrefix);
122    
123            public Properties getProperties(String prefix, boolean removePrefix)
124                    throws SystemException;
125    
126            public short getShort(long companyId, String name)
127                    throws SystemException;
128    
129            public short getShort(long companyId, String name, short defaultValue)
130                    throws SystemException;
131    
132            public short getShort(
133                    PortletPreferences preferences, long companyId, String name);
134    
135            public short getShort(
136                    PortletPreferences preferences, long companyId, String name,
137                    short defaultValue);
138    
139            public short getShort(String name) throws SystemException;
140    
141            public short getShort(String name, short defaultValue)
142                    throws SystemException;
143    
144            public String getString(long companyId, String name)
145                    throws SystemException;
146    
147            public String getString(long companyId, String name, String defaultValue)
148                    throws SystemException;
149    
150            public String getString(
151                    PortletPreferences preferences, long companyId, String name);
152    
153            public String getString(
154                    PortletPreferences preferences, long companyId, String name,
155                    boolean defaultValue);
156    
157            public String getString(
158                    PortletPreferences preferences, long companyId, String name,
159                    double defaultValue);
160    
161            public String getString(
162                    PortletPreferences preferences, long companyId, String name,
163                    int defaultValue);
164    
165            public String getString(
166                    PortletPreferences preferences, long companyId, String name,
167                    long defaultValue);
168    
169            public String getString(
170                    PortletPreferences preferences, long companyId, String name,
171                    short defaultValue);
172    
173            public String getString(
174                    PortletPreferences preferences, long companyId, String name,
175                    String defaultValue);
176    
177            public String getString(String name) throws SystemException;
178    
179            public String getString(String name, String defaultValue)
180                    throws SystemException;
181    
182            public String[] getStringArray(
183                            long companyId, String name, String delimiter)
184                    throws SystemException;
185    
186            public String[] getStringArray(
187                            long companyId, String name, String delimiter,
188                            String[] defaultValue)
189                    throws SystemException;
190    
191            public String[] getStringArray(
192                    PortletPreferences preferences, long companyId, String name,
193                    String delimiter);
194    
195            public String[] getStringArray(
196                    PortletPreferences preferences, long companyId, String name,
197                    String delimiter, String[] defaultValue);
198    
199            public String[] getStringArray(String name, String delimiter)
200                    throws SystemException;
201    
202            public String[] getStringArray(
203                            String name, String delimiter, String[] defaultValue)
204                    throws SystemException;
205    
206            public String getStringFromNames(long companyId, String... names)
207                    throws SystemException;
208    
209    }