Interface ConversionMap<K,V>
-
- All Superinterfaces:
Map<K,V>
public interface ConversionMap<K,V> extends Map<K,V>
This is a specific type of map that allows for converting from a data type to a given type. For instance, aColumnMap
contains column names from an SQL table as its keys and the values are the entries, which are strings. A call togetDate(Object)
would convert the string to a date object. This encapsulates all the work involved in converting between objects. This is part of the data abstraction layer for all stores.Created by Jeff Gaynor
on 4/16/12 at 12:06 PM
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
getBoolean(K key)
Convenience method to change the value to a booleanbyte[]
getBytes(K key)
Convenience method to change the value to a byte array.Date
getDate(K key)
Convenience method to change the value to a date.Identifier
getIdentifier(K key)
Convenience method to change the value to an identifierint
getInteger(K key)
Convenience method to change the value to an integer.long
getLong(K key)
Convenience method to change the value to a long.String
getString(K key)
Convenience method to change the value to a stringURI
getURI(K key)
Convenience method to change the value to a URI.ConversionMap<K,V>
removeKeys(List<String> attr)
Returns a copy of this with the given keyus removed.-
Methods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
-
-
-
Method Detail
-
getDate
Date getDate(K key)
Convenience method to change the value to a date.- Parameters:
key
-- Returns:
-
getBoolean
boolean getBoolean(K key)
Convenience method to change the value to a boolean- Parameters:
key
-- Returns:
-
getLong
long getLong(K key)
Convenience method to change the value to a long.- Parameters:
key
-- Returns:
-
getInteger
int getInteger(K key)
Convenience method to change the value to an integer.- Parameters:
key
-- Returns:
-
getString
String getString(K key)
Convenience method to change the value to a string- Parameters:
key
-- Returns:
-
getIdentifier
Identifier getIdentifier(K key)
Convenience method to change the value to an identifier- Parameters:
key
-- Returns:
-
getURI
URI getURI(K key)
Convenience method to change the value to a URI.- Parameters:
key
-- Returns:
-
getBytes
byte[] getBytes(K key)
Convenience method to change the value to a byte array. Note that if the value is already a byte array (such as a BLOB in a database) it is simply returned unaltered.- Parameters:
key
-- Returns:
-
removeKeys
ConversionMap<K,V> removeKeys(List<String> attr)
Returns a copy of this with the given keyus removed.- Parameters:
attr
-
-
-