org.jboss.portal.server.plugins.preferences
Class SimpleMergeStrategy

java.lang.Object
  extended by org.jboss.portal.server.plugins.preferences.SimpleMergeStrategy
All Implemented Interfaces:
MergeStrategy

public class SimpleMergeStrategy
extends java.lang.Object
implements MergeStrategy


Constructor Summary
SimpleMergeStrategy()
           
 
Method Summary
 java.util.Set getKeySet(PreferenceSet[] sets)
          Return the merged key set.
 Preference getPreference(PreferenceSet[] sets, java.lang.String key)
          Return a preference among the sets or null if no suitable preference is found.
static SimpleMergeStrategy getSingleton()
           
 boolean isReadOnly(PreferenceSet[] sets, java.lang.String key)
          Say if the preference is marked as read only.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleMergeStrategy

public SimpleMergeStrategy()
Method Detail

getSingleton

public static SimpleMergeStrategy getSingleton()

getPreference

public Preference getPreference(PreferenceSet[] sets,
                                java.lang.String key)
                         throws java.lang.IllegalArgumentException
Description copied from interface: MergeStrategy
Return a preference among the sets or null if no suitable preference is found.

Specified by:
getPreference in interface MergeStrategy
Parameters:
sets - the set of preference to inspect
key - the requested key
Returns:
the found preference or null
Throws:
java.lang.IllegalArgumentException - if the key or the sets is null

isReadOnly

public boolean isReadOnly(PreferenceSet[] sets,
                          java.lang.String key)
                   throws java.lang.IllegalArgumentException
Description copied from interface: MergeStrategy
Say if the preference is marked as read only.

Specified by:
isReadOnly in interface MergeStrategy
Parameters:
sets - the set of preference to inspect
key - the requested key
Returns:
the read only value
Throws:
java.lang.IllegalArgumentException - if the key or the sets is null

getKeySet

public java.util.Set getKeySet(PreferenceSet[] sets)
                        throws java.lang.IllegalArgumentException
Description copied from interface: MergeStrategy
Return the merged key set.

Specified by:
getKeySet in interface MergeStrategy
Parameters:
sets - the set of preference to inspect
Returns:
the merged key set
Throws:
java.lang.IllegalArgumentException - if tje sets is null