org.apache.wicket.util.value
Interface IValueMap

All Superinterfaces:
java.util.Map
All Known Implementing Classes:
AttributeMap, CopyOnWriteValueMap, PageParameters, ValueMap

public interface IValueMap
extends java.util.Map

A Map interface that holds values, parses strings and exposes a variety of convenience methods.

Author:
jcompagner

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Method Summary
 void clear()
           
 boolean getBoolean(java.lang.String key)
          Gets a boolean value by key.
 java.lang.CharSequence getCharSequence(java.lang.String key)
          Gets a string by key.
 double getDouble(java.lang.String key)
          Gets a double value by key.
 double getDouble(java.lang.String key, double defaultValue)
          Gets a double using a default if not found.
 Duration getDuration(java.lang.String key)
          Gets a duration.
 int getInt(java.lang.String key)
          Gets an int.
 int getInt(java.lang.String key, int defaultValue)
          Gets an int, using a default if not found.
 java.lang.String getKey(java.lang.String key)
          Provided the hash key is a string and you need to access the value ignoring ignoring the keys case (upper or lower letter), than you may use this method to get the correct writing.
 long getLong(java.lang.String key)
          Gets a long.
 long getLong(java.lang.String key, long defaultValue)
          Gets a long using a default if not found.
 java.lang.String getString(java.lang.String key)
          Gets a string by key.
 java.lang.String getString(java.lang.String key, java.lang.String defaultValue)
          Gets a string by key.
 java.lang.String[] getStringArray(java.lang.String key)
          Gets a String array by key.
 StringValue getStringValue(java.lang.String key)
          Gets a StringValue by key.
 Time getTime(java.lang.String key)
          Gets a time.
 boolean isImmutable()
          Gets whether this value map is made immutable.
 IValueMap makeImmutable()
          Makes this value map immutable by changing the underlying map representation to a collections "unmodifiableMap".
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
           
 void putAll(java.util.Map map)
           
 java.lang.Object remove(java.lang.Object key)
           
 
Methods inherited from interface java.util.Map
containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, size, values
 

Method Detail

clear

void clear()
Specified by:
clear in interface java.util.Map
See Also:
Map.clear()

getBoolean

boolean getBoolean(java.lang.String key)
                   throws StringValueConversionException
Gets a boolean value by key.

Parameters:
key - The key
Returns:
The value
Throws:
StringValueConversionException

getDouble

double getDouble(java.lang.String key)
                 throws StringValueConversionException
Gets a double value by key.

Parameters:
key - The key
Returns:
The value
Throws:
StringValueConversionException

getDouble

double getDouble(java.lang.String key,
                 double defaultValue)
                 throws StringValueConversionException
Gets a double using a default if not found.

Parameters:
key - The key
defaultValue - Value to use if no value in map
Returns:
The value
Throws:
StringValueConversionException

getDuration

Duration getDuration(java.lang.String key)
                     throws StringValueConversionException
Gets a duration.

Parameters:
key - The key
Returns:
The value
Throws:
StringValueConversionException

getInt

int getInt(java.lang.String key)
           throws StringValueConversionException
Gets an int.

Parameters:
key - The key
Returns:
The value
Throws:
StringValueConversionException

getInt

int getInt(java.lang.String key,
           int defaultValue)
           throws StringValueConversionException
Gets an int, using a default if not found.

Parameters:
key - The key
defaultValue - Value to use if no value in map
Returns:
The value
Throws:
StringValueConversionException

getLong

long getLong(java.lang.String key)
             throws StringValueConversionException
Gets a long.

Parameters:
key - The key
Returns:
The value
Throws:
StringValueConversionException

getLong

long getLong(java.lang.String key,
             long defaultValue)
             throws StringValueConversionException
Gets a long using a default if not found.

Parameters:
key - The key
defaultValue - Value to use if no value in map
Returns:
The value
Throws:
StringValueConversionException

getString

java.lang.String getString(java.lang.String key,
                           java.lang.String defaultValue)
Gets a string by key.

Parameters:
key - The get
defaultValue - Default value to return if value is null
Returns:
The string

getString

java.lang.String getString(java.lang.String key)
Gets a string by key.

Parameters:
key - The get
Returns:
The string

getCharSequence

java.lang.CharSequence getCharSequence(java.lang.String key)
Gets a string by key.

Parameters:
key - The get
Returns:
The string

getStringArray

java.lang.String[] getStringArray(java.lang.String key)
Gets a String array by key. If the value was a String[] it will be returned directly. If it was a String it will be converted to a String array of one. If it was an array of another type a String array will be made and the elements will be converted to a string.

Parameters:
key -
Returns:
The String array of that key

getStringValue

StringValue getStringValue(java.lang.String key)
Gets a StringValue by key.

Parameters:
key - The key
Returns:
The string value object

getTime

Time getTime(java.lang.String key)
             throws StringValueConversionException
Gets a time.

Parameters:
key - The key
Returns:
The value
Throws:
StringValueConversionException

isImmutable

boolean isImmutable()
Gets whether this value map is made immutable.

Returns:
whether this value map is made immutable

makeImmutable

IValueMap makeImmutable()
Makes this value map immutable by changing the underlying map representation to a collections "unmodifiableMap". After calling this method, any attempt to modify this map will result in a runtime exception being thrown by the collections classes.

Returns:
this

put

java.lang.Object put(java.lang.Object key,
                     java.lang.Object value)
Specified by:
put in interface java.util.Map
See Also:
Map.put(Object, Object)

putAll

void putAll(java.util.Map map)
Specified by:
putAll in interface java.util.Map
See Also:
Map.putAll(java.util.Map)

remove

java.lang.Object remove(java.lang.Object key)
Specified by:
remove in interface java.util.Map
See Also:
Map.remove(java.lang.Object)

getKey

java.lang.String getKey(java.lang.String key)
Provided the hash key is a string and you need to access the value ignoring ignoring the keys case (upper or lower letter), than you may use this method to get the correct writing.

Parameters:
key -
Returns:
The key with the correct writing


Copyright © 2004-2007 Apache Software Foundation. All Rights Reserved.