001
014
015 package com.liferay.portlet;
016
017 import java.io.Serializable;
018
019 import java.util.Enumeration;
020 import java.util.Map;
021
022 import javax.portlet.PortletPreferences;
023 import javax.portlet.ReadOnlyException;
024
025
028 public class PortletPreferencesWrapper
029 implements PortletPreferences, Serializable {
030
031 public PortletPreferencesWrapper(PortletPreferences portletPreferences) {
032 _portletPreferences = portletPreferences;
033 }
034
035 @Override
036 public boolean equals(Object obj) {
037 if (this == obj) {
038 return true;
039 }
040
041 if (!(obj instanceof PortletPreferencesWrapper)) {
042 return false;
043 }
044
045 PortletPreferencesWrapper portletPreferencesWrapper =
046 (PortletPreferencesWrapper)obj;
047
048 if (getPortletPreferencesImpl().equals(
049 portletPreferencesWrapper.getPortletPreferencesImpl())) {
050
051 return true;
052 }
053 else {
054 return false;
055 }
056 }
057
058 @Override
059 public Map<String, String[]> getMap() {
060 return _portletPreferences.getMap();
061 }
062
063 @Override
064 public Enumeration<String> getNames() {
065 return _portletPreferences.getNames();
066 }
067
068 public PortletPreferencesImpl getPortletPreferencesImpl() {
069 return (PortletPreferencesImpl)_portletPreferences;
070 }
071
072
075 @Deprecated
076 public PortletPreferencesImpl getPreferencesImpl() {
077 return getPortletPreferencesImpl();
078 }
079
080 @Override
081 public String getValue(String key, String def) {
082 return _portletPreferences.getValue(key, def);
083 }
084
085 @Override
086 public String[] getValues(String key, String[] def) {
087 return _portletPreferences.getValues(key, def);
088 }
089
090 @Override
091 public int hashCode() {
092 return _portletPreferences.hashCode();
093 }
094
095 @Override
096 public boolean isReadOnly(String key) {
097 return _portletPreferences.isReadOnly(key);
098 }
099
100 @Override
101 public void reset(String key) throws ReadOnlyException {
102 _portletPreferences.reset(key);
103 }
104
105 @Override
106 public void setValue(String key, String value) throws ReadOnlyException {
107 _portletPreferences.setValue(key, value);
108 }
109
110 @Override
111 public void setValues(String key, String[] values)
112 throws ReadOnlyException {
113
114 _portletPreferences.setValues(key, values);
115 }
116
117 @Override
118 public void store() {
119
120
121
122 throw new IllegalStateException(
123 "Preferences cannot be stored inside a render call");
124 }
125
126 private final PortletPreferences _portletPreferences;
127
128 }