Package org.dalesbred.internal.result
Class MapResultSetProcessor<K,V>
- java.lang.Object
-
- org.dalesbred.internal.result.MapResultSetProcessor<K,V>
-
- All Implemented Interfaces:
ResultSetProcessor<java.util.Map<K,V>>
public final class MapResultSetProcessor<K,V> extends java.lang.Object implements ResultSetProcessor<java.util.Map<K,V>>
ResultSetProcessor that expects results with two columns and creates map from them.This processor updates the map in order in which the rows are read. Therefore, if the keys of the result are not distinct, the result contains the last binding of given key.
-
-
Constructor Summary
Constructors Constructor Description MapResultSetProcessor(@NotNull java.lang.Class<K> keyType, @NotNull java.lang.Class<V> valueType, @NotNull InstantiatorProvider instantiatorRegistry)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull java.util.Map<K,V>
process(@NotNull java.sql.ResultSet resultSet)
-
-
-
Constructor Detail
-
MapResultSetProcessor
public MapResultSetProcessor(@NotNull @NotNull java.lang.Class<K> keyType, @NotNull @NotNull java.lang.Class<V> valueType, @NotNull @NotNull InstantiatorProvider instantiatorRegistry)
-
-
Method Detail
-
process
@NotNull public @NotNull java.util.Map<K,V> process(@NotNull @NotNull java.sql.ResultSet resultSet) throws java.sql.SQLException
- Specified by:
process
in interfaceResultSetProcessor<K>
- Throws:
java.sql.SQLException
-
-