atg.svc.repository.service
Class UserOptionsService.LazyUserOptionsMap

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap
          extended by atg.svc.repository.service.UserOptionsService.LazyUserOptionsMap
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map
Enclosing class:
UserOptionsService

protected class UserOptionsService.LazyUserOptionsMap
extends java.util.HashMap

A Map for UserOptions that waits until get() or containsKey() is called to load the UserOption value into the Map. keyed off the UserOption name. This will allows formhandlers and input/getvalueof tags to use a Map for working with the UserOptions without having to load every UserOption in the system first.

See Also:
Serialized Form

Constructor Summary
UserOptionsService.LazyUserOptionsMap(java.lang.String pProfileId)
           
 
Method Summary
 boolean containsKey(java.lang.Object key)
          Returns true if this map contains a mapping for the specified key.
 java.lang.Object get(java.lang.Object key)
          Gets the site option from the hashmap if it exists.
 
Methods inherited from class java.util.HashMap
clear, clone, containsValue, entrySet, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

UserOptionsService.LazyUserOptionsMap

public UserOptionsService.LazyUserOptionsMap(java.lang.String pProfileId)
Method Detail

get

public java.lang.Object get(java.lang.Object key)
Gets the site option from the hashmap if it exists. If not it will go out to the repository, load it and put it into the map. This allows formhandlers to just load only the site options that are being edited into the map instead of every map in the system.

Specified by:
get in interface java.util.Map
Overrides:
get in class java.util.HashMap
Parameters:
key - the key whose associated value is to be returned.
Returns:
the value to which this map maps the specified key, or null if the map contains no mapping for this key.
See Also:
HashMap.put(Object, Object)

containsKey

public boolean containsKey(java.lang.Object key)
Returns true if this map contains a mapping for the specified key. If the Map does not contain the given key an attempt is made to load the option from the repository and put it into the map. If the option does not exist in the repository and therefore cannot be loaded into the map false is returned.

Specified by:
containsKey in interface java.util.Map
Overrides:
containsKey in class java.util.HashMap
Parameters:
key - The key whose presence in this map is to be tested
Returns:
true if this map contains a mapping for the specified key.