|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.wicket.util.value.CopyOnWriteValueMap
public class CopyOnWriteValueMap
An implementation of IValueMap
that makes a copy when a caller tries to change an
immutable Map
. That is, the Map
may or may not be immutable, but if it
is, a copy is made.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface java.util.Map |
---|
Map.Entry<K,V> |
Constructor Summary | |
---|---|
CopyOnWriteValueMap(IValueMap wrapped)
Constructor. |
Method Summary | ||
---|---|---|
void |
clear()
|
|
boolean |
containsKey(Object key)
|
|
boolean |
containsValue(Object value)
|
|
Set |
entrySet()
|
|
boolean |
equals(Object o)
|
|
Object |
get(Object key)
|
|
Boolean |
getAsBoolean(String key)
Retrieves a Boolean value by key. |
|
boolean |
getAsBoolean(String key,
boolean defaultValue)
Retrieves a boolean value by key. |
|
Double |
getAsDouble(String key)
Retrieves a Double value by key. |
|
double |
getAsDouble(String key,
double defaultValue)
Retrieves a double value by key. |
|
Duration |
getAsDuration(String key)
Retrieves a Duration value by key. |
|
Duration |
getAsDuration(String key,
Duration defaultValue)
Retrieves a Duration value by key. |
|
|
getAsEnum(String key,
Class<T> eClass)
Retrieves an Enum value by key. |
|
|
getAsEnum(String key,
Class<T> eClass,
T defaultValue)
Retrieves an Enum value by key. |
|
|
getAsEnum(String key,
T defaultValue)
Retrieves an Enum value by key. |
|
Integer |
getAsInteger(String key)
Retrieves an Integer value by key. |
|
int |
getAsInteger(String key,
int defaultValue)
Retrieves an integer value by key. |
|
Long |
getAsLong(String key)
Retrieves a Long value by key. |
|
long |
getAsLong(String key,
long defaultValue)
Retrieves a long value by key. |
|
Time |
getAsTime(String key)
Retrieves a Time value by key. |
|
Time |
getAsTime(String key,
Time defaultValue)
Retrieves a Time value by key. |
|
boolean |
getBoolean(String key)
Retrieves a boolean value by key. |
|
CharSequence |
getCharSequence(String key)
Retrieves a CharSequence by key. |
|
double |
getDouble(String key)
Retrieves a double value by key. |
|
double |
getDouble(String key,
double defaultValue)
Retrieves a double value by key, using a default value if not found. |
|
Duration |
getDuration(String key)
Retrieves a Duration by key. |
|
int |
getInt(String key)
Retrieves an int value by key. |
|
int |
getInt(String key,
int defaultValue)
Retrieves an int value by key, using a default value if not found. |
|
String |
getKey(String key)
Provided that the hash key is a String and you need to access the value ignoring
the key's case (upper- or lowercase letters), then you may use this method to get the correct
writing. |
|
long |
getLong(String key)
Retrieves a long value by key. |
|
long |
getLong(String key,
long defaultValue)
Retrieves a long value by key, using a default value if not found. |
|
String |
getString(String key)
Retrieves a String by key. |
|
String |
getString(String key,
String defaultValue)
Retrieves a String by key, using a default value if not found. |
|
String[] |
getStringArray(String key)
Retrieves a String array by key. |
|
StringValue |
getStringValue(String key)
Retrieves a StringValue object by key. |
|
Time |
getTime(String key)
Retrieves a Time object by key. |
|
boolean |
isEmpty()
|
|
boolean |
isImmutable()
Returns whether or not this IValueMap is immutable. |
|
Set |
keySet()
|
|
IValueMap |
makeImmutable()
Makes this IValueMap immutable by changing the underlying map representation to
a Collections.unmodifiableMap . |
|
Object |
put(String key,
Object value)
|
|
void |
putAll(Map map)
|
|
Object |
remove(Object key)
|
|
int |
size()
|
|
String |
toString()
|
|
Collection |
values()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
---|
hashCode |
Constructor Detail |
---|
public CopyOnWriteValueMap(IValueMap wrapped)
wrapped
- the wrapped IValueMap
Method Detail |
---|
public void clear()
clear
in interface Map<String,Object>
Map.clear()
public boolean containsKey(Object key)
containsKey
in interface Map<String,Object>
Map.containsKey(Object)
public boolean containsValue(Object value)
containsValue
in interface Map<String,Object>
Map.containsValue(Object)
public Set entrySet()
entrySet
in interface Map<String,Object>
Map.entrySet()
public boolean equals(Object o)
equals
in interface Map<String,Object>
equals
in class Object
Map.equals(Object)
public Object get(Object key)
get
in interface Map<String,Object>
Map.get(Object)
public boolean getBoolean(String key) throws StringValueConversionException
IValueMap
boolean
value by key.
getBoolean
in interface IValueMap
key
- the key
StringValueConversionException
IValueMap.getBoolean(String)
public CharSequence getCharSequence(String key)
IValueMap
CharSequence
by key.
getCharSequence
in interface IValueMap
key
- the key
CharSequence
IValueMap.getCharSequence(String)
public double getDouble(String key) throws StringValueConversionException
IValueMap
double
value by key.
getDouble
in interface IValueMap
key
- the key
StringValueConversionException
IValueMap.getDouble(String)
public double getDouble(String key, double defaultValue) throws StringValueConversionException
IValueMap
double
value by key, using a default value if not found.
getDouble
in interface IValueMap
key
- the keydefaultValue
- value to use if no value is in this IValueMap
StringValueConversionException
IValueMap.getDouble(String, double)
public Duration getDuration(String key) throws StringValueConversionException
IValueMap
Duration
by key.
getDuration
in interface IValueMap
key
- the key
Duration
value
StringValueConversionException
IValueMap.getDuration(String)
public int getInt(String key, int defaultValue) throws StringValueConversionException
IValueMap
int
value by key, using a default value if not found.
getInt
in interface IValueMap
key
- the keydefaultValue
- value to use if no value is in this IValueMap
StringValueConversionException
IValueMap.getInt(String, int)
public int getInt(String key) throws StringValueConversionException
IValueMap
int
value by key.
getInt
in interface IValueMap
key
- the key
StringValueConversionException
IValueMap.getInt(String)
public String getKey(String key)
IValueMap
String
and you need to access the value ignoring
the key's case (upper- or lowercase letters), then you may use this method to get the correct
writing.
getKey
in interface IValueMap
key
- the key
IValueMap.getKey(String)
public long getLong(String key, long defaultValue) throws StringValueConversionException
IValueMap
long
value by key, using a default value if not found.
getLong
in interface IValueMap
key
- the keydefaultValue
- value to use if no value in this IValueMap
StringValueConversionException
IValueMap.getLong(String, long)
public long getLong(String key) throws StringValueConversionException
IValueMap
long
value by key.
getLong
in interface IValueMap
key
- the key
StringValueConversionException
IValueMap.getLong(String)
public String getString(String key, String defaultValue)
IValueMap
String
by key, using a default value if not found.
getString
in interface IValueMap
key
- the keydefaultValue
- default value to return if value is null
String
IValueMap.getString(String, String)
public String getString(String key)
IValueMap
String
by key.
getString
in interface IValueMap
key
- the key
String
IValueMap.getString(String)
public String[] getStringArray(String key)
IValueMap
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 length one. If it was an array of another type, a
String
array will be made and each element will be converted to a
String
.
getStringArray
in interface IValueMap
key
- the key
String
array of that keyIValueMap.getStringArray(String)
public StringValue getStringValue(String key)
IValueMap
StringValue
object by key.
getStringValue
in interface IValueMap
key
- the key
StringValue
objectIValueMap.getStringValue(String)
public Time getTime(String key) throws StringValueConversionException
IValueMap
Time
object by key.
getTime
in interface IValueMap
key
- the key
Time
object
StringValueConversionException
IValueMap.getTime(String)
public boolean isEmpty()
isEmpty
in interface Map<String,Object>
Map.isEmpty()
public boolean isImmutable()
IValueMap
IValueMap
is immutable.
isImmutable
in interface IValueMap
IValueMap
is immutableIValueMap.isImmutable()
public Set keySet()
keySet
in interface Map<String,Object>
Map.keySet()
public IValueMap makeImmutable()
IValueMap
IValueMap
immutable by changing the underlying map representation to
a Collections.unmodifiableMap
. After calling this method, any attempt to modify
this IValueMap
will result in a RuntimeException
being thrown by
the Collections
framework.
makeImmutable
in interface IValueMap
IValueMap
IValueMap.makeImmutable()
public Object put(String key, Object value)
put
in interface Map<String,Object>
Map.put(Object, Object)
public void putAll(Map map)
putAll
in interface Map<String,Object>
Map.putAll(Map)
public Object remove(Object key)
remove
in interface Map<String,Object>
Map.remove(Object)
public int size()
size
in interface Map<String,Object>
Map.size()
public Collection values()
values
in interface Map<String,Object>
Map.values()
public String toString()
toString
in class Object
IValueMap#toString()
public Boolean getAsBoolean(String key)
IValueMap
Boolean
value by key.
getAsBoolean
in interface IValueMap
key
- the key
IValueMap
IValueMap.getAsBoolean(String)
public boolean getAsBoolean(String key, boolean defaultValue)
IValueMap
boolean
value by key.
getAsBoolean
in interface IValueMap
key
- the keydefaultValue
- the default to return
IValueMap
IValueMap.getAsBoolean(String, boolean)
public Integer getAsInteger(String key)
IValueMap
Integer
value by key.
getAsInteger
in interface IValueMap
key
- the key
IValueMap
IValueMap.getAsInteger(String)
public int getAsInteger(String key, int defaultValue)
IValueMap
integer
value by key.
getAsInteger
in interface IValueMap
key
- the keydefaultValue
- the default to return
IValueMap
IValueMap.getAsInteger(String, int)
public Long getAsLong(String key)
IValueMap
Long
value by key.
getAsLong
in interface IValueMap
key
- the key
IValueMap
IValueMap.getAsLong(String)
public long getAsLong(String key, long defaultValue)
IValueMap
long
value by key.
getAsLong
in interface IValueMap
key
- the keydefaultValue
- the default to return
IValueMap
IValueMap.getAsLong(String, long)
public Double getAsDouble(String key)
IValueMap
Double
value by key.
getAsDouble
in interface IValueMap
key
- the key
IValueMap
IValueMap.getAsDouble(String)
public double getAsDouble(String key, double defaultValue)
IValueMap
double
value by key.
getAsDouble
in interface IValueMap
key
- the keydefaultValue
- the default to return
IValueMap
IValueMap.getAsDouble(String, double)
public Duration getAsDuration(String key)
IValueMap
Duration
value by key.
getAsDuration
in interface IValueMap
key
- the key
IValueMap
IValueMap.getAsDuration(String)
public Duration getAsDuration(String key, Duration defaultValue)
IValueMap
Duration
value by key.
getAsDuration
in interface IValueMap
key
- the keydefaultValue
- the default to return
IValueMap
IValueMap.getAsDuration(String, Duration)
public Time getAsTime(String key)
IValueMap
Time
value by key.
getAsTime
in interface IValueMap
key
- the key
IValueMap
IValueMap.getAsTime(String)
public Time getAsTime(String key, Time defaultValue)
IValueMap
Time
value by key.
getAsTime
in interface IValueMap
key
- the keydefaultValue
- the default to return
IValueMap
IValueMap.getAsTime(String, Time)
public <T extends Enum<T>> T getAsEnum(String key, Class<T> eClass)
IValueMap
Enum
value by key.
getAsEnum
in interface IValueMap
T
- type of enumkey
- the keyeClass
- the enumeration class
IValueMap
IValueMap.getAsEnum(String, Class)
public <T extends Enum<T>> T getAsEnum(String key, T defaultValue)
IValueMap
Enum
value by key.
getAsEnum
in interface IValueMap
T
- type of enumkey
- the keydefaultValue
- the default value from the Enumeration (cannot be null)
IValueMap
IValueMap.getAsEnum(java.lang.String, java.lang.Class)
public <T extends Enum<T>> T getAsEnum(String key, Class<T> eClass, T defaultValue)
IValueMap
Enum
value by key.
getAsEnum
in interface IValueMap
T
- type of enumkey
- the keyeClass
- the enumeration classdefaultValue
- the default value from the Enumeration (may be null)
IValueMap
IValueMap.getAsEnum(String, Class, Enum)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |