nl.lxtreme.ols.api
Interface UserSettings

All Superinterfaces:
Iterable<Map.Entry<String,Object>>, Serializable

public interface UserSettings
extends Serializable, Iterable<Map.Entry<String,Object>>

Denotes an abstract way for obtaining/storing user settings.


Method Summary
 String get(String aName, String aDefaultValue)
          Returns the string value associated with the given name, returning a given default value if no value is (yet) associated.
 boolean getBoolean(String aName, boolean aDefaultValue)
          Returns the boolean value associated with the given name, returning a given default value if no value is (yet) associated.
 int getInt(String aName, int aDefaultValue)
          Returns the integer value associated with the given name, returning a given default value if no value is (yet) associated.
 long getLong(String aName, long aDefaultValue)
          Returns the long value associated with the given name, returning a given default value if no value is (yet) associated.
 String getName()
          Returns the symbolic name for this user settings.
 void put(String aName, String aValue)
          Associates the given String value to the given name.
 void putAll(Map<?,?> aSettings)
          Allows all given map of settings to be copied to this user settings.
 void putBoolean(String aName, boolean aValue)
          Associates the given boolean value to the given name.
 void putInt(String aName, int aValue)
          Associates the given integer value to the given name.
 void putLong(String aName, long aValue)
          Associates the given long value to the given name.
 
Methods inherited from interface java.lang.Iterable
iterator
 

Method Detail

get

String get(String aName,
           String aDefaultValue)
Returns the string value associated with the given name, returning a given default value if no value is (yet) associated.

Parameters:
aName - the name of whose associated value should be returned;
aDefaultValue - the default value to return.
Returns:
the value associated with the given name, or the given default.

getBoolean

boolean getBoolean(String aName,
                   boolean aDefaultValue)
Returns the boolean value associated with the given name, returning a given default value if no value is (yet) associated.

Parameters:
aName - the name of whose associated value should be returned;
aDefaultValue - the default value to return.
Returns:
the value associated with the given name, or the given default.

getInt

int getInt(String aName,
           int aDefaultValue)
Returns the integer value associated with the given name, returning a given default value if no value is (yet) associated.

Parameters:
aName - the name of whose associated value should be returned;
aDefaultValue - the default value to return.
Returns:
the value associated with the given name, or the given default.

getLong

long getLong(String aName,
             long aDefaultValue)
Returns the long value associated with the given name, returning a given default value if no value is (yet) associated.

Parameters:
aName - the name of whose associated value should be returned;
aDefaultValue - the default value to return.
Returns:
the value associated with the given name, or the given default.

getName

String getName()
Returns the symbolic name for this user settings.

Returns:
a symbolic name, never null.

put

void put(String aName,
         String aValue)
Associates the given String value to the given name.

Parameters:
aName - the name to associate the value to;
aValue - the value to associate to the given name.

putAll

void putAll(Map<?,?> aSettings)
Allows all given map of settings to be copied to this user settings.

Parameters:
aSettings - the map with settings to copy, cannot be null.

putBoolean

void putBoolean(String aName,
                boolean aValue)
Associates the given boolean value to the given name.

Parameters:
aName - the name to associate the value to;
aValue - the value to associate to the given name.

putInt

void putInt(String aName,
            int aValue)
Associates the given integer value to the given name.

Parameters:
aName - the name to associate the value to;
aValue - the value to associate to the given name.

putLong

void putLong(String aName,
             long aValue)
Associates the given long value to the given name.

Parameters:
aName - the name to associate the value to;
aValue - the value to associate to the given name.


Copyright © 2012 L'Xtreme IT consultancy. All Rights Reserved.