Package org.xmpp.util
Class ValueWrapper<V extends Serializable>
java.lang.Object
org.xmpp.util.ValueWrapper<V>
- All Implemented Interfaces:
Serializable
A wrapper implementation for cached values, suitable for
Map based
caches where a significant portion of keys matches the corresponding value
exactly.- Author:
- Guus der Kinderen, guus.der.kinderen@gmail.com
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumIndication of how the key of this cache entry represents the cache value. -
Constructor Summary
ConstructorsConstructorDescriptionConstructs an empty wrapper.ValueWrapper(Exception exception) Constructs a wrapper that is used to indicate that the key that maps to this value cannot be used to generate a valid valueValueWrapper(V value) Wraps a value while using theUSE_VALUErepresentation. -
Method Summary
-
Constructor Details
-
ValueWrapper
public ValueWrapper()Constructs an empty wrapper. This wrapper is used to indicate that the key that maps to this value is an exact duplicate of the generated value. -
ValueWrapper
Constructs a wrapper that is used to indicate that the key that maps to this value cannot be used to generate a valid value- Parameters:
exception- Describes the invalidity of the key.
-
ValueWrapper
Wraps a value while using theUSE_VALUErepresentation.- Parameters:
value- The value that is wrapped.
-
-
Method Details
-
getValue
Returns the wrapped value, ornullif the representation used in this instance is not USE_VALUE;- Returns:
- the wrapped value.
-
getRepresentation
-
getExceptionMessage
Returns the message describing the invalidity of the key that maps to this instance.- Returns:
- An exception message , possibly null.
-
toString
-