
org.summerb.approaches.jdbccrud.api.dto.tools.EasyCrudDtoUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of summerb Show documentation
Show all versions of summerb Show documentation
summerb - is a set of building blocks for real-world java-based web apps
package org.summerb.approaches.jdbccrud.api.dto.tools;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import org.summerb.approaches.jdbccrud.api.dto.HasId;
public abstract class EasyCrudDtoUtils {
private EasyCrudDtoUtils() {
}
public static > Set enumerateIds(Iterable iterable) {
// TODO: Use streams
Set ret = new HashSet<>();
for (HasId row : iterable) {
ret.add(row.getId());
}
return ret;
}
public static > Map toMapById(Iterable iterable) {
// TODO: Use streams
Map ret = new HashMap<>();
for (TDto row : iterable) {
ret.put(row.getId(), row);
}
return ret;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy