1.1 --- a/java/sql-dk/src/info/globalcode/sql/dk/Functions.java Sat Dec 21 22:22:30 2013 +0100
1.2 +++ b/java/sql-dk/src/info/globalcode/sql/dk/Functions.java Sun Dec 22 18:19:38 2013 +0100
1.3 @@ -17,6 +17,7 @@
1.4 */
1.5 package info.globalcode.sql.dk;
1.6
1.7 +import info.globalcode.sql.dk.configuration.NameIdentified;
1.8 import java.util.ArrayList;
1.9 import java.util.Collection;
1.10 import java.util.Map;
1.11 @@ -84,4 +85,14 @@
1.12 return c;
1.13 }
1.14 }
1.15 +
1.16 + public static <T extends NameIdentified> T findByName(Collection<T> collection, String name) {
1.17 + for (T element : collection) {
1.18 + if (equalz(element.getName(), name)) {
1.19 + return element;
1.20 + }
1.21 + }
1.22 +
1.23 + return null;
1.24 + }
1.25 }