use of org.jooq.exception.InvalidResultException in project jOOQ by jOOQ.
the class ResultImpl method intoMap.
@Override
public final <K, V> Map<K, V> intoMap(RecordMapper<? super R, K> keyMapper, RecordMapper<? super R, V> valueMapper) {
Map<K, V> map = new LinkedHashMap<K, V>();
for (R record : this) {
K key = keyMapper.map(record);
V value = valueMapper.map(record);
if (map.put(key, value) != null)
throw new InvalidResultException("Key list " + key + " is not unique in Result for " + this);
}
return map;
}
Aggregations