@Test public void testGetValues() throws ReadOnlyException, ValidatorException, IOException { addPref(basePrefs, "key1", false, null); addPref(basePrefs, "key2", false, new String[] {}); addPref(basePrefs, "key3", false, new String[] {null}); addPref(basePrefs, "key4", false, new String[] {"value1", "value2"}); String[] values = portletPreferences.getValues("key0", new String[] {"FOOBAR"}); assertArrayEquals(new String[] {"FOOBAR"}, values); values = portletPreferences.getValues("key1", new String[] {"FOOBAR"}); assertNull(values); values = portletPreferences.getValues("key2", new String[] {"FOOBAR"}); assertArrayEquals(new String[] {}, values); values = portletPreferences.getValues("key3", new String[] {"FOOBAR"}); assertArrayEquals(new String[] {null}, values); values = portletPreferences.getValues("key4", new String[] {"FOOBAR"}); assertArrayEquals(new String[] {"value1", "value2"}, values); }
@Override public final String[] getValues(String key, String[] def) { final IPortletPreference portletPreference = this.getPortletPreference(key); if (portletPreference != null) { return portletPreference.getValues(); } return def; }
AbstractPortletPreferencesImpl implements PortletPreferences { @Override public final String[] getValues(String key, String[] def) { final IPortletPreference portletPreference = this.getPortletPreference(key); if (portletPreference != null) { return portletPreference.getValues(); } return def; } }
AbstractPortletPreferencesImpl implements PortletPreferences { @Override public final String[] getValues(String key, String[] def) { final IPortletPreference portletPreference = this.getPortletPreference(key); if (portletPreference != null) { return portletPreference.getValues(); } return def; } AbstractPortletPreferencesImpl(boolean render); }
AbstractPortletPreferencesImpl implements PortletPreferences { @Override public final String[] getValues(String key, String[] def) { final IPortletPreference portletPreference = this.getPortletPreference(key); if (portletPreference != null) { return portletPreference.getValues(); } return def; } AbstractPortletPreferencesImpl(boolean render); @Override final boolean isReadOnly(String key); @Override final String getValue(String key, String def); @Override final String[] getValues(String key, String[] def); @Override final void setValue(String key, String value); @Override final void setValues(String key, String[] values); @Override final Enumeration<String> getNames(); @Override final Map<String, String[]> getMap(); @Override final void reset(String key); @Override final void store(); }
AbstractPortletPreferencesImpl implements PortletPreferences { @Override public final String[] getValues(String key, String[] def) { final IPortletPreference portletPreference = this.getPortletPreference(key); if (portletPreference != null) { return portletPreference.getValues(); } return def; } AbstractPortletPreferencesImpl(boolean render); @Override final boolean isReadOnly(String key); @Override final String getValue(String key, String def); @Override final String[] getValues(String key, String[] def); @Override final void setValue(String key, String value); @Override final void setValues(String key, String[] values); @Override final Enumeration<String> getNames(); @Override final Map<String, String[]> getMap(); @Override final void reset(String key); @Override final void store();  }