MockPortletPreferences (Spring Framework 3.2.1.RELEASE API)
Date: 2013-01-24

org.springframework.mock.web.portlet

## Class MockPortletPreferences

- java.lang.Object
- - org.springframework.mock.web.portlet.MockPortletPreferences

- All Implemented Interfaces:
    PortletPreferences

      public class MockPortletPreferences
      extends Object
      implements PortletPreferences

  Mock implementation of the `PortletPreferences` interface.
  Since:
    2.0
  Author:
    John A. Lewis, Juergen Hoeller

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MockPortletPreferences()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Map<String,String[]>` | `getMap()`
    `Enumeration<String>` | `getNames()`
    `String` | `getValue(String key, String def)`
    `String[]` | `getValues(String key, String[] def)`
    `boolean` | `isReadOnly(String key)`
    `void` | `reset(String key)`
    `void` | `setPreferencesValidator(PreferencesValidator preferencesValidator)`
    `void` | `setReadOnly(String key, boolean readOnly)`
    `void` | `setValue(String key, String value)`
    `void` | `setValues(String key, String[] values)`
    `void` | `store()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### MockPortletPreferences

          public MockPortletPreferences()

  - ### Method Detail

    - #### setReadOnly

          public void setReadOnly(String key,
                         boolean readOnly)

    - #### isReadOnly

          public boolean isReadOnly(String key)

      Specified by:
        `isReadOnly` in interface `PortletPreferences`

    - #### getValue

          public String getValue(String key,
                        String def)

      Specified by:
        `getValue` in interface `PortletPreferences`

    - #### getValues

          public String[] getValues(String key,
                           String[] def)

      Specified by:
        `getValues` in interface `PortletPreferences`

    - #### setValue

          public void setValue(String key,
                      String value)
                        throws ReadOnlyException

      Specified by:
        `setValue` in interface `PortletPreferences`
      Throws:
        `ReadOnlyException`

    - #### setValues

          public void setValues(String key,
                       String[] values)
                         throws ReadOnlyException

      Specified by:
        `setValues` in interface `PortletPreferences`
      Throws:
        `ReadOnlyException`

    - #### getNames

          public Enumeration<String> getNames()

      Specified by:
        `getNames` in interface `PortletPreferences`

    - #### getMap

          public Map<String,String[]> getMap()

      Specified by:
        `getMap` in interface `PortletPreferences`

    - #### reset

          public void reset(String key)
                     throws ReadOnlyException

      Specified by:
        `reset` in interface `PortletPreferences`
      Throws:
        `ReadOnlyException`

    - #### setPreferencesValidator

          public void setPreferencesValidator(PreferencesValidator preferencesValidator)

    - #### store

          public void store()
                     throws IOException,
                            ValidatorException

      Specified by:
        `store` in interface `PortletPreferences`
      Throws:
        `IOException`
        `ValidatorException`