org.apache.turbine.services.pull.util

## Class SessionData

- java.lang.Object
- - org.apache.turbine.services.pull.util.SessionData

- All Implemented Interfaces:
    ApplicationTool

      public class SessionData
      extends Object
      implements ApplicationTool

  Pull tool designed to be used in the session scope for storage of temporary data. This tool should eliminate the need for the `User.setTemp(java.lang.String, java.lang.Object)` and `User.getTemp(java.lang.String)` methods.
  Version:
    $Id: SessionData.java 1706239 2015-10-01 13:18:35Z tv $
  Author:
    Quinton McCombs

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SessionData()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clear()` Clears all data
    `boolean` | `containsKey(String key)` Determines is a given key is stored.
    `Object` | `get(String key)` Gets the data stored under the key.
    `void` | `init(Object data)` Initialize the application tool.
    `Iterator<String>` | `iterator()` Gets a iterator for the keys.
    `void` | `put(String key, Object value)` Stores the data.
    `void` | `refresh()` Refresh the application tool.

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

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

- - ### Constructor Detail

    - #### SessionData

          public SessionData()

  - ### Method Detail

    - #### init

          public void init(Object data)

      Initialize the application tool.
      Specified by:
        `init` in interface `ApplicationTool`
      Parameters:
        `data` - initialization data

    - #### refresh

          public void refresh()

      Refresh the application tool.
      Specified by:
        `refresh` in interface `ApplicationTool`

    - #### get

          public Object get(String key)

      Gets the data stored under the key. Null will be returned if the key does not exist or if null was stored under the key.

      To check for a key with a null value use `containsKey(java.lang.String)`.

      Parameters:
        `key` - key under which the data is stored.
      Returns:
        `Object` stored under the key.

    - #### containsKey

          public boolean containsKey(String key)

      Determines is a given key is stored.
      Parameters:
        `key` - the key to check for
      Returns:
        true if the key was found

    - #### put

          public void put(String key,
                 Object value)

      Stores the data. If the key already exists, the value will be overwritten.
      Parameters:
        `key` - key under which the data will be stored.
        `value` - data to store under the key. Null values are allowed.

    - #### clear

          public void clear()

      Clears all data

    - #### iterator

          public Iterator<String> iterator()

      Gets a iterator for the keys.
      Returns:
        `Iterator` for the keys

Copyright © 2000–2018 The Apache Software Foundation. All rights reserved.