|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.apama.correlator.memstore.DefaultRowKeyValueConverter<K,V>
K
- The type parameter used by the table for keys - typically String or ObjectV
- The type parameter used by the table for values - typically RowValue or Objectpublic class DefaultRowKeyValueConverter<K,V>
Helper class for implementing RowKeyValueConverter using String for the keys and RowValue for the values.
This class may be a useful starting point for creating converter subclasses that use an application-specific class for row values, but still use String for keys. It could also be used by a table class with Object,Object generic type parameters where some table instances need to use application-specific converter classes, but others will consist entirely of String,RowValue pairs and should use this default converter instead. ConcurrentMapAdapter subclasses that do not use any application-specific key/value types do not need this class.
Note that although the generic K,V type parameters of this class are unbound (so it can be used in Object,Object tables as well as String,RowValue tables), the default implementation of each method assumes that all keys are of String type and values are of the RowValue type so errors will be raised if an unmodified instance of this class is used in a table that contains application-specific K,V classes.
Constructor Summary | |
---|---|
DefaultRowKeyValueConverter()
|
Method Summary | |
---|---|
V |
fromRowValue(RowValue o)
Converts a RowValue object to the custom application-specific object that should be used for values in this table. |
K |
fromStringKey(java.lang.String o)
Converts a string to the application-specific object that should be used for keys in this table. |
RowValue |
toRowValue(V o)
Converts an application-specific row value object to a RowValue. |
java.lang.String |
toStringKey(K o)
Converts an application-specific key object to a string. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultRowKeyValueConverter()
Method Detail |
---|
public V fromRowValue(RowValue o)
RowKeyValueConverter
fromRowValue
in interface RowKeyValueConverter<K,V>
o
- the row value to convert
public RowValue toRowValue(V o)
RowKeyValueConverter
toRowValue
in interface RowKeyValueConverter<K,V>
o
- the row value to convert
public K fromStringKey(java.lang.String o)
RowKeyValueConverter
Most maps use String or Object so there is usually nothing to do but a cast.
fromStringKey
in interface RowKeyValueConverter<K,V>
o
- the string representation of the key
public java.lang.String toStringKey(K o)
RowKeyValueConverter
If the map is keyed by strings, this should simply return the argument cast to a String.
toStringKey
in interface RowKeyValueConverter<K,V>
o
- the key to convert
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |