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(long companyId)
111                    throws SystemException;
112    
113            public Properties getProperties(
114                    PortletPreferences preferences, long companyId, String prefix,
115                    boolean removePrefix);
116    
117            public Properties getProperties(String prefix, boolean removePrefix)
118                    throws SystemException;
119    
120            public short getShort(long companyId, String name)
121                    throws SystemException;
122    
123            public short getShort(long companyId, String name, short defaultValue)
124                    throws SystemException;
125    
126            public short getShort(
127                    PortletPreferences preferences, long companyId, String name);
128    
129            public short getShort(
130                    PortletPreferences preferences, long companyId, String name,
131                    short defaultValue);
132    
133            public short getShort(String name) throws SystemException;
134    
135            public short getShort(String name, short defaultValue)
136                    throws SystemException;
137    
138            public String getString(long companyId, String name)
139                    throws SystemException;
140    
141            public String getString(long companyId, String name, String defaultValue)
142                    throws SystemException;
143    
144            public String getString(
145                    PortletPreferences preferences, long companyId, String name);
146    
147            public String getString(
148                    PortletPreferences preferences, long companyId, String name,
149                    boolean defaultValue);
150    
151            public String getString(
152                    PortletPreferences preferences, long companyId, String name,
153                    double defaultValue);
154    
155            public String getString(
156                    PortletPreferences preferences, long companyId, String name,
157                    int defaultValue);
158    
159            public String getString(
160                    PortletPreferences preferences, long companyId, String name,
161                    long defaultValue);
162    
163            public String getString(
164                    PortletPreferences preferences, long companyId, String name,
165                    short defaultValue);
166    
167            public String getString(
168                    PortletPreferences preferences, long companyId, String name,
169                    String defaultValue);
170    
171            public String getString(String name) throws SystemException;
172    
173            public String getString(String name, String defaultValue)
174                    throws SystemException;
175    
176            public String[] getStringArray(
177                            long companyId, String name, String delimiter)
178                    throws SystemException;
179    
180            public String[] getStringArray(
181                            long companyId, String name, String delimiter,
182                            String[] defaultValue)
183                    throws SystemException;
184    
185            public String[] getStringArray(
186                    PortletPreferences preferences, long companyId, String name,
187                    String delimiter);
188    
189            public String[] getStringArray(
190                    PortletPreferences preferences, long companyId, String name,
191                    String delimiter, String[] defaultValue);
192    
193            public String[] getStringArray(String name, String delimiter)
194                    throws SystemException;
195    
196            public String[] getStringArray(
197                            String name, String delimiter, String[] defaultValue)
198                    throws SystemException;
199    
200            public String getStringFromNames(long companyId, String... names)
201                    throws SystemException;
202    
203    }