com.apama.correlator.memstore
Interface RowKeyValueConverter<K,V>

All Known Implementing Classes:
DefaultRowKeyValueConverter

public interface RowKeyValueConverter<K,V>

Interface to allow custom application-specific Java classes to be used to represent keys and values instead of the default String (for keys) and RowValue classes.

To fulfil the contract of ConcurrentMap it is essential that all key and value objects have valid implementations of equals() and hashCode().


Method Summary
 V fromRowValue(RowValue value)
          Converts a RowValue object to the custom application-specific object that should be used for values in this table.
 K fromStringKey(java.lang.String key)
          Converts a string to the application-specific object that should be used for keys in this table.
 RowValue toRowValue(V value)
          Converts an application-specific row value object to a RowValue.
 java.lang.String toStringKey(K key)
          Converts an application-specific key object to a string.
 

Method Detail

fromRowValue

V fromRowValue(RowValue value)
Converts a RowValue object to the custom application-specific object that should be used for values in this table.

Parameters:
value - the row value to convert
Returns:
must be null if value is null

toRowValue

RowValue toRowValue(V value)
Converts an application-specific row value object to a RowValue.

Parameters:
value - the row value to convert
Returns:
must be null if value is null

fromStringKey

K fromStringKey(java.lang.String key)
Converts a string to the application-specific object that should be used for keys in this table.

Most maps use String or Object so there is usually nothing to do but a cast.

Parameters:
key - the string representation of the key
Returns:
application-specific object representing the key

toStringKey

java.lang.String toStringKey(K key)
Converts an application-specific key object to a string.

If the map is keyed by strings, this should simply return the argument cast to a String.

Parameters:
key - the key to convert
Returns:
String representation of the key; must return null if input key is null


Submit a bug or feature
Copyright (c) 2013 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or Terracotta Inc., San Francisco, CA, USA, and/or Software AG (Canada) Inc., Cambridge, Ontario, Canada, and/or, Software AG (UK) Ltd., Derby, United Kingdom, and/or Software A.G. (Israel) Ltd., Or-Yehuda, Israel and/or their licensors. Use, reproduction, transfer, publication or disclosure is prohibited except as specifically provided for in your License Agreement with Software AG