|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 |
---|
java.util.Map.Entry<K,V> |
Constructor Summary | |
---|---|
CopyOnWriteValueMap(IValueMap wrapped)
Constructor. |
Method Summary | ||
---|---|---|
void |
clear()
|
|
boolean |
containsKey(java.lang.Object key)
|
|
boolean |
containsValue(java.lang.Object value)
|
|
java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.Object>> |
entrySet()
|
|
boolean |
equals(java.lang.Object o)
|
|
java.lang.Object |
get(java.lang.Object key)
|
|
java.lang.Boolean |
getAsBoolean(java.lang.String key)
Retrieves a Boolean value by key. |
|
boolean |
getAsBoolean(java.lang.String key,
boolean defaultValue)
Retrieves a boolean value by key. |
|
java.lang.Double |
getAsDouble(java.lang.String key)
Retrieves a Double value by key. |
|
double |
getAsDouble(java.lang.String key,
double defaultValue)
Retrieves a double value by key. |
|
Duration |
getAsDuration(java.lang.String key)
Retrieves a Duration value by key. |
|
Duration |
getAsDuration(java.lang.String key,
Duration defaultValue)
Retrieves a Duration value by key. |
|
|
getAsEnum(java.lang.String key,
java.lang.Class<T> eClass)
Retrieves an Enum value by key. |
|
|
getAsEnum(java.lang.String key,
java.lang.Class<T> eClass,
T defaultValue)
Retrieves an Enum value by key. |
|
|
getAsEnum(java.lang.String key,
T defaultValue)
Retrieves an Enum value by key. |
|
java.lang.Integer |
getAsInteger(java.lang.String key)
Retrieves an Integer value by key. |
|
int |
getAsInteger(java.lang.String key,
int defaultValue)
Retrieves an integer value by key. |
|
java.lang.Long |
getAsLong(java.lang.String key)
Retrieves a Long value by key. |
|
long |
getAsLong(java.lang.String key,
long defaultValue)
Retrieves a long value by key. |
|
Time |
getAsTime(java.lang.String key)
Retrieves a Time value by key. |
|
Time |
getAsTime(java.lang.String key,
Time defaultValue)
Retrieves a Time value by key. |
|
boolean |
getBoolean(java.lang.String key)
Retrieves a boolean value by key. |
|
java.lang.CharSequence |
getCharSequence(java.lang.String key)
Retrieves a CharSequence by key. |
|
double |
getDouble(java.lang.String key)
Retrieves a double value by key. |
|
double |
getDouble(java.lang.String key,
double defaultValue)
Retrieves a double value by key, using a default value if not found. |
|
Duration |
getDuration(java.lang.String key)
Retrieves a Duration by key. |
|
int |
getInt(java.lang.String key)
Retrieves an int value by key. |
|
int |
getInt(java.lang.String key,
int defaultValue)
Retrieves an int value by key, using a default value if not found. |
|
java.lang.String |
getKey(java.lang.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(java.lang.String key)
Retrieves a long value by key. |
|
long |
getLong(java.lang.String key,
long defaultValue)
Retrieves a long value by key, using a default value if not found. |
|
java.lang.String |
getString(java.lang.String key)
Retrieves a String by key. |
|
java.lang.String |
getString(java.lang.String key,
java.lang.String defaultValue)
Retrieves a String by key, using a default value if not found. |
|
java.lang.String[] |
getStringArray(java.lang.String key)
Retrieves a String array by key. |
|
StringValue |
getStringValue(java.lang.String key)
Retrieves a StringValue object by key. |
|
Time |
getTime(java.lang.String key)
Retrieves a Time object by key. |
|
boolean |
isEmpty()
|
|
boolean |
isImmutable()
Returns whether or not this IValueMap is immutable. |
|
java.util.Set<java.lang.String> |
keySet()
|
|
IValueMap |
makeImmutable()
Makes this IValueMap immutable by changing the underlying map representation to
a Collections.unmodifiableMap . |
|
java.lang.Object |
put(java.lang.String key,
java.lang.Object value)
|
|
void |
putAll(java.util.Map<? extends java.lang.String,?> map)
|
|
java.lang.Object |
remove(java.lang.Object key)
|
|
int |
size()
|
|
java.lang.String |
toString()
|
|
java.util.Collection<java.lang.Object> |
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 java.util.Map<java.lang.String,java.lang.Object>
Map.clear()
public boolean containsKey(java.lang.Object key)
containsKey
in interface java.util.Map<java.lang.String,java.lang.Object>
Map.containsKey(Object)
public boolean containsValue(java.lang.Object value)
containsValue
in interface java.util.Map<java.lang.String,java.lang.Object>
Map.containsValue(Object)
public java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.Object>> entrySet()
entrySet
in interface java.util.Map<java.lang.String,java.lang.Object>
Map.entrySet()
public boolean equals(java.lang.Object o)
equals
in interface java.util.Map<java.lang.String,java.lang.Object>
equals
in class java.lang.Object
Map.equals(Object)
public java.lang.Object get(java.lang.Object key)
get
in interface java.util.Map<java.lang.String,java.lang.Object>
Map.get(Object)
public boolean getBoolean(java.lang.String key) throws StringValueConversionException
IValueMap
boolean
value by key.
getBoolean
in interface IValueMap
key
- the key
StringValueConversionException
IValueMap.getBoolean(String)
public java.lang.CharSequence getCharSequence(java.lang.String key)
IValueMap
CharSequence
by key.
getCharSequence
in interface IValueMap
key
- the key
CharSequence
IValueMap.getCharSequence(String)
public double getDouble(java.lang.String key) throws StringValueConversionException
IValueMap
double
value by key.
getDouble
in interface IValueMap
key
- the key
StringValueConversionException
IValueMap.getDouble(String)
public double getDouble(java.lang.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(java.lang.String key) throws StringValueConversionException
IValueMap
Duration
by key.
getDuration
in interface IValueMap
key
- the key
Duration
value
StringValueConversionException
IValueMap.getDuration(String)
public int getInt(java.lang.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(java.lang.String key) throws StringValueConversionException
IValueMap
int
value by key.
getInt
in interface IValueMap
key
- the key
StringValueConversionException
IValueMap.getInt(String)
public java.lang.String getKey(java.lang.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(java.lang.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(java.lang.String key) throws StringValueConversionException
IValueMap
long
value by key.
getLong
in interface IValueMap
key
- the key
StringValueConversionException
IValueMap.getLong(String)
public java.lang.String getString(java.lang.String key, java.lang.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 java.lang.String getString(java.lang.String key)
IValueMap
String
by key.
getString
in interface IValueMap
key
- the key
String
IValueMap.getString(String)
public java.lang.String[] getStringArray(java.lang.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(java.lang.String key)
IValueMap
StringValue
object by key.
getStringValue
in interface IValueMap
key
- the key
StringValue
objectIValueMap.getStringValue(String)
public Time getTime(java.lang.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 java.util.Map<java.lang.String,java.lang.Object>
Map.isEmpty()
public boolean isImmutable()
IValueMap
IValueMap
is immutable.
isImmutable
in interface IValueMap
IValueMap
is immutableIValueMap.isImmutable()
public java.util.Set<java.lang.String> keySet()
keySet
in interface java.util.Map<java.lang.String,java.lang.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 java.lang.Object put(java.lang.String key, java.lang.Object value)
put
in interface java.util.Map<java.lang.String,java.lang.Object>
Map.put(Object, Object)
public void putAll(java.util.Map<? extends java.lang.String,?> map)
putAll
in interface java.util.Map<java.lang.String,java.lang.Object>
Map.putAll(Map)
public java.lang.Object remove(java.lang.Object key)
remove
in interface java.util.Map<java.lang.String,java.lang.Object>
Map.remove(Object)
public int size()
size
in interface java.util.Map<java.lang.String,java.lang.Object>
Map.size()
public java.util.Collection<java.lang.Object> values()
values
in interface java.util.Map<java.lang.String,java.lang.Object>
Map.values()
public java.lang.String toString()
toString
in class java.lang.Object
IValueMap#toString()
public java.lang.Boolean getAsBoolean(java.lang.String key)
IValueMap
Boolean
value by key.
getAsBoolean
in interface IValueMap
key
- the key
IValueMap
IValueMap.getAsBoolean(String)
public boolean getAsBoolean(java.lang.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 java.lang.Integer getAsInteger(java.lang.String key)
IValueMap
Integer
value by key.
getAsInteger
in interface IValueMap
key
- the key
IValueMap
IValueMap.getAsInteger(String)
public int getAsInteger(java.lang.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 java.lang.Long getAsLong(java.lang.String key)
IValueMap
Long
value by key.
getAsLong
in interface IValueMap
key
- the key
IValueMap
IValueMap.getAsLong(String)
public long getAsLong(java.lang.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 java.lang.Double getAsDouble(java.lang.String key)
IValueMap
Double
value by key.
getAsDouble
in interface IValueMap
key
- the key
IValueMap
IValueMap.getAsDouble(String)
public double getAsDouble(java.lang.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(java.lang.String key)
IValueMap
Duration
value by key.
getAsDuration
in interface IValueMap
key
- the key
IValueMap
IValueMap.getAsDuration(String)
public Duration getAsDuration(java.lang.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(java.lang.String key)
IValueMap
Time
value by key.
getAsTime
in interface IValueMap
key
- the key
IValueMap
IValueMap.getAsTime(String)
public Time getAsTime(java.lang.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 java.lang.Enum<T>> T getAsEnum(java.lang.String key, java.lang.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 java.lang.Enum<T>> T getAsEnum(java.lang.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 java.lang.Enum<T>> T getAsEnum(java.lang.String key, java.lang.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 |