LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.misc
Class LyThreadData<T>

java.lang.Object
  extended by leon.misc.LyThreadData<T>

public class LyThreadData<T>
extends java.lang.Object

This class is used to store and retrieve datas associated to the current thread.


Field Summary
static java.lang.String __VERSION
           
 
Constructor Summary
LyThreadData()
          Default constructor.
 
Method Summary
 T getData(java.lang.String key)
          Gets the current object associated to the given key for the current thread.
 T putData(java.lang.String key, T data)
          Sets the object associated to the given key for the current thread.
 T removeData(java.lang.String key)
          Sets the object associated to the given key for the current thread.
 void removeKeys(T data)
          Remove all keys associated to given object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

__VERSION

public static final java.lang.String __VERSION
See Also:
Constant Field Values
Constructor Detail

LyThreadData

public LyThreadData()
Default constructor.

Method Detail

getData

public T getData(java.lang.String key)
Gets the current object associated to the given key for the current thread.

Parameters:
key - The key for which the instance is looked for.
Returns:
Instance of the current object (may be null) associated to the given key if it was not set in the current thread.

putData

public T putData(java.lang.String key,
                 T data)
Sets the object associated to the given key for the current thread.

Parameters:
key - The key for which the instance is stored.
context - Object corresponding to the given key for the current thread. If null, unset instance associated to the key.
Returns:
Previous value associated to the given key.

removeData

public T removeData(java.lang.String key)
Sets the object associated to the given key for the current thread.

Parameters:
key - The key for which the instance is stored.
context - Object corresponding to the given key for the current thread. If null, unset instance associated to the key.

removeKeys

public void removeKeys(T data)
Remove all keys associated to given object.

Parameters:
data - The data to be removed

(c) January 2013 - W4 S.A.

Website: W4 S.A., contact us: support@w4global.com