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 aQute.bnd.annotation.ProviderType;
018    
019    import java.util.Properties;
020    
021    import javax.portlet.PortletPreferences;
022    
023    /**
024     * @author Brian Wing Shun Chan
025     */
026    @ProviderType
027    public interface PrefsProps {
028    
029            public boolean getBoolean(long companyId, String name);
030    
031            public boolean getBoolean(
032                    long companyId, String name, boolean defaultValue);
033    
034            /**
035             * @deprecated As of 7.0.0, replaced by {@link
036             *             #getBoolean(PortletPreferences, String)}
037             */
038            @Deprecated
039            public boolean getBoolean(
040                    PortletPreferences preferences, long companyId, String name);
041    
042            /**
043             * @deprecated As of 7.0.0, replaced by {@link
044             *             #getBoolean(PortletPreferences, String, boolean)}
045             */
046            @Deprecated
047            public boolean getBoolean(
048                    PortletPreferences preferences, long companyId, String name,
049                    boolean defaultValue);
050    
051            public boolean getBoolean(PortletPreferences preferences, String name);
052    
053            public boolean getBoolean(
054                    PortletPreferences preferences, String name, boolean defaultValue);
055    
056            public boolean getBoolean(String name);
057    
058            public boolean getBoolean(String name, boolean defaultValue);
059    
060            public String getContent(long companyId, String name);
061    
062            /**
063             * @deprecated As of 7.0.0, replaced by {@link
064             *             #getContent(PortletPreferences, String)}
065             */
066            @Deprecated
067            public String getContent(
068                    PortletPreferences preferences, long companyId, String name);
069    
070            public String getContent(PortletPreferences preferences, String name);
071    
072            public String getContent(String name);
073    
074            public double getDouble(long companyId, String name);
075    
076            public double getDouble(long companyId, String name, double defaultValue);
077    
078            /**
079             * @deprecated As of 7.0.0, replaced by {@link
080             *             #getDouble(PortletPreferences, String)}
081             */
082            @Deprecated
083            public double getDouble(
084                    PortletPreferences preferences, long companyId, String name);
085    
086            /**
087             * @deprecated As of 7.0.0, replaced by {@link
088             *             #getDouble(PortletPreferences, String, double)}
089             */
090            @Deprecated
091            public double getDouble(
092                    PortletPreferences preferences, long companyId, String name,
093                    double defaultValue);
094    
095            public double getDouble(PortletPreferences preferences, String name);
096    
097            public double getDouble(
098                    PortletPreferences preferences, String name, double defaultValue);
099    
100            public double getDouble(String name);
101    
102            public double getDouble(String name, double defaultValue);
103    
104            public int getInteger(long companyId, String name);
105    
106            public int getInteger(long companyId, String name, int defaultValue);
107    
108            /**
109             * @deprecated As of 7.0.0, replaced by {@link
110             *             #getInteger(PortletPreferences, String)}
111             */
112            @Deprecated
113            public int getInteger(
114                    PortletPreferences preferences, long companyId, String name);
115    
116            /**
117             * @deprecated As of 7.0.0, replaced by {@link
118             *             #getInteger(PortletPreferences, String, int)}
119             */
120            @Deprecated
121            public int getInteger(
122                    PortletPreferences preferences, long companyId, String name,
123                    int defaultValue);
124    
125            public int getInteger(PortletPreferences preferences, String name);
126    
127            public int getInteger(
128                    PortletPreferences preferences, String name, int defaultValue);
129    
130            public int getInteger(String name);
131    
132            public int getInteger(String name, int defaultValue);
133    
134            public long getLong(long companyId, String name);
135    
136            public long getLong(long companyId, String name, long defaultValue);
137    
138            /**
139             * @deprecated As of 7.0.0, replaced by {@link
140             *             #getLong(PortletPreferences, String)}
141             */
142            @Deprecated
143            public long getLong(
144                    PortletPreferences preferences, long companyId, String name);
145    
146            /**
147             * @deprecated As of 7.0.0, replaced by {@link
148             *             #getLong(PortletPreferences, String, long)}
149             */
150            @Deprecated
151            public long getLong(
152                    PortletPreferences preferences, long companyId, String name,
153                    long defaultValue);
154    
155            public long getLong(PortletPreferences preferences, String name);
156    
157            public long getLong(
158                    PortletPreferences preferences, String name, long defaultValue);
159    
160            public long getLong(String name);
161    
162            public long getLong(String name, long defaultValue);
163    
164            public PortletPreferences getPreferences();
165    
166            public PortletPreferences getPreferences(boolean readOnly);
167    
168            public PortletPreferences getPreferences(long companyId);
169    
170            public PortletPreferences getPreferences(long companyId, boolean readOnly);
171    
172            /**
173             * @deprecated As of 7.0.0, replaced by {@link
174             *             #getProperties(PortletPreferences, String, boolean)}
175             */
176            @Deprecated
177            public Properties getProperties(
178                    PortletPreferences preferences, long companyId, String prefix,
179                    boolean removePrefix);
180    
181            public Properties getProperties(
182                    PortletPreferences preferences, String prefix, boolean removePrefix);
183    
184            public Properties getProperties(String prefix, boolean removePrefix);
185    
186            public short getShort(long companyId, String name);
187    
188            public short getShort(long companyId, String name, short defaultValue);
189    
190            /**
191             * @deprecated As of 7.0.0, replaced by {@link
192             *             #getShort(PortletPreferences, String)}
193             */
194            @Deprecated
195            public short getShort(
196                    PortletPreferences preferences, long companyId, String name);
197    
198            /**
199             * @deprecated As of 7.0.0, replaced by {@link
200             *             #getShort(PortletPreferences, String, short)}
201             */
202            @Deprecated
203            public short getShort(
204                    PortletPreferences preferences, long companyId, String name,
205                    short defaultValue);
206    
207            public short getShort(PortletPreferences preferences, String name);
208    
209            public short getShort(
210                    PortletPreferences preferences, String name, short defaultValue);
211    
212            public short getShort(String name);
213    
214            public short getShort(String name, short defaultValue);
215    
216            public String getString(long companyId, String name);
217    
218            public String getString(long companyId, String name, String defaultValue);
219    
220            /**
221             * @deprecated As of 7.0.0, replaced by {@link
222             *             #getString(PortletPreferences, String)}
223             */
224            @Deprecated
225            public String getString(
226                    PortletPreferences preferences, long companyId, String name);
227    
228            /**
229             * @deprecated As of 7.0.0, replaced by {@link
230             *             #getString(PortletPreferences, String, boolean)}
231             */
232            @Deprecated
233            public String getString(
234                    PortletPreferences preferences, long companyId, String name,
235                    boolean defaultValue);
236    
237            /**
238             * @deprecated As of 7.0.0, replaced by {@link
239             *             #getString(PortletPreferences, String, double)}
240             */
241            @Deprecated
242            public String getString(
243                    PortletPreferences preferences, long companyId, String name,
244                    double defaultValue);
245    
246            /**
247             * @deprecated As of 7.0.0, replaced by {@link
248             *             #getString(PortletPreferences, String, int)}
249             */
250            @Deprecated
251            public String getString(
252                    PortletPreferences preferences, long companyId, String name,
253                    int defaultValue);
254    
255            /**
256             * @deprecated As of 7.0.0, replaced by {@link
257             *             #getString(PortletPreferences, String, long)}
258             */
259            @Deprecated
260            public String getString(
261                    PortletPreferences preferences, long companyId, String name,
262                    long defaultValue);
263    
264            /**
265             * @deprecated As of 7.0.0, replaced by {@link
266             *             #getString(PortletPreferences, String, short)}
267             */
268            @Deprecated
269            public String getString(
270                    PortletPreferences preferences, long companyId, String name,
271                    short defaultValue);
272    
273            /**
274             * @deprecated As of 7.0.0, replaced by {@link
275             *             #getString(PortletPreferences, String, String)}
276             */
277            @Deprecated
278            public String getString(
279                    PortletPreferences preferences, long companyId, String name,
280                    String defaultValue);
281    
282            public String getString(PortletPreferences preferences, String name);
283    
284            public String getString(
285                    PortletPreferences preferences, String name, boolean defaultValue);
286    
287            public String getString(
288                    PortletPreferences preferences, String name, double defaultValue);
289    
290            public String getString(
291                    PortletPreferences preferences, String name, int defaultValue);
292    
293            public String getString(
294                    PortletPreferences preferences, String name, long defaultValue);
295    
296            public String getString(
297                    PortletPreferences preferences, String name, short defaultValue);
298    
299            public String getString(
300                    PortletPreferences preferences, String name, String defaultValue);
301    
302            public String getString(String name);
303    
304            public String getString(String name, String defaultValue);
305    
306            public String[] getStringArray(
307                    long companyId, String name, String delimiter);
308    
309            public String[] getStringArray(
310                    long companyId, String name, String delimiter, String[] defaultValue);
311    
312            /**
313             * @deprecated As of 7.0.0, replaced by {@link
314             *             #getStringArray(PortletPreferences, String, String)}
315             */
316            @Deprecated
317            public String[] getStringArray(
318                    PortletPreferences preferences, long companyId, String name,
319                    String delimiter);
320    
321            /**
322             * @deprecated As of 7.0.0, replaced by {@link
323             *             #getStringArray(PortletPreferences, String, String,
324             *             String[])}
325             */
326            @Deprecated
327            public String[] getStringArray(
328                    PortletPreferences preferences, long companyId, String name,
329                    String delimiter, String[] defaultValue);
330    
331            public String[] getStringArray(
332                    PortletPreferences preferences, String name, String delimiter);
333    
334            public String[] getStringArray(
335                    PortletPreferences preferences, String name, String delimiter,
336                    String[] defaultValue);
337    
338            public String[] getStringArray(String name, String delimiter);
339    
340            public String[] getStringArray(
341                    String name, String delimiter, String[] defaultValue);
342    
343            public String getStringFromNames(long companyId, String... names);
344    
345    }