--- a/java/sql-dk/src/info/globalcode/sql/dk/Functions.java Sat Dec 21 22:22:30 2013 +0100
+++ b/java/sql-dk/src/info/globalcode/sql/dk/Functions.java Sun Dec 22 18:19:38 2013 +0100
@@ -17,6 +17,7 @@
*/
package info.globalcode.sql.dk;
+import info.globalcode.sql.dk.configuration.NameIdentified;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Map;
@@ -84,4 +85,14 @@
return c;
}
}
+
+ public static <T extends NameIdentified> T findByName(Collection<T> collection, String name) {
+ for (T element : collection) {
+ if (equalz(element.getName(), name)) {
+ return element;
+ }
+ }
+
+ return null;
+ }
}