ca.bc.gov.webade.preferences.util
Class WebADEPreferenceUtils

java.lang.Object
  extended byca.bc.gov.webade.preferences.util.WebADEPreferenceUtils

public final class WebADEPreferenceUtils
extends java.lang.Object

Author:
jross

Method Summary
static WebADEPreferences loadWebADEPreferences(WebADEPreferenceIterator iterator, WebADEPreferenceType preferenceType)
          Creates a set of preferences from the given iterator.
static WebADEPreferences mergePreferences(WebADEPreferences basePreferences, WebADEPreferences newPreferences)
          Adds the new preferences to the base preferences, overriding any matching preferences with the ones in the new preferences.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

loadWebADEPreferences

public static final WebADEPreferences loadWebADEPreferences(WebADEPreferenceIterator iterator,
                                                            WebADEPreferenceType preferenceType)
                                                     throws WebADEException
Creates a set of preferences from the given iterator.

Parameters:
iterator - The iterator used to load the preferences from.
preferenceType - The type of preferences to load.
Returns:
The loaded preferences object.
Throws:
WebADEException - Thrown if an error occurs while loading the user preferences.

mergePreferences

public static final WebADEPreferences mergePreferences(WebADEPreferences basePreferences,
                                                       WebADEPreferences newPreferences)
Adds the new preferences to the base preferences, overriding any matching preferences with the ones in the new preferences.

Parameters:
basePreferences - The base set of preferences.
newPreferences - The new set of preferences to add to the base set.
Returns:
The merged preferences.