bootique-jdbc-test/src/main/java/io/bootique/jdbc/test/Table.java
public Map<Object, Object[]> selectAsMap(String mapColumn) {

        int mapColumnIndex = columnIndex(mapColumn);
        if (mapColumnIndex < 0) {
            throw new IllegalArgumentException("Unknown column: " + mapColumn);
        }

        List<Object[]> list = select();

        Map<Object, Object[]> map = new HashMap<>();

        list.forEach(r -> {
            Object[] existing = map.put(r[mapColumnIndex], r);
            if (existing != null) {
                throw new IllegalArgumentException("More than one row matches '" + r[mapColumnIndex] + "' value");
            }
        });

        return map;
    }
/**
     * Performs select operation against the table, returning result as a map using provided unique column as a key.
     *
     * @param mapColumn the name of a unique column to use as a map key.
     * @return a map using provided unique column as a key.
     * @since 0.21
     */
Performs select operation against the table, returning result as a map using provided unique column as a key.
@param mapColumn the name of a unique column to use as a map key.
@return a map using provided unique column as a key.
Performs select operation against the table returning result as a map using provided unique column as a key . @param mapColumn the name of a unique column to use as a map key . @return a map using provided unique column as a key .
public Map<Object, Object[]> selectAsMap(String mapColumn) {
        int mapColumnIndex = columnIndex(mapColumn);
        if (mapColumnIndex < 0) {
            throw new IllegalArgumentException("Unknown column: " + mapColumn);
        }
        List<Object[]> list = select();
        Map<Object, Object[]> map = new HashMap<>();
        list.forEach(r -> {
            Object[] existing = map.put(r[mapColumnIndex], r);
            if (existing != null) {
                throw new IllegalArgumentException("More than one row matches '" + r[mapColumnIndex] + "' value");
            }
        });
        return map;
    }
public Map < Object , Object [ ] > selectAsMap ( String mapColumn ) { int mapColumnIndex = columnIndex ( mapColumn ) ; if ( mapColumnIndex < 0 ) { throw new IllegalArgumentException ( "Unknown column: " + mapColumn ) ; } List < Object [ ] > list = select ( ) ; Map < Object , Object [ ] > map = new HashMap < > ( ) ; list . forEach ( r -> { Object [ ] existing = map . put ( r [ mapColumnIndex ] , r ) ; if ( existing != null ) { throw new IllegalArgumentException ( "More than one row matches '" + r [ mapColumnIndex ] + "' value" ) ; } } ) ; return map ; }
Performs select operation against the table, returning result as a map using provided unique column as a key.
Performs select operation against the table returning result as a map using provided unique column as a key .