diff --git a/openbis_api/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/Code.java b/openbis_api/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/Code.java index 5da1653842a95da7aefbb96a39e6641cf42934f1..51c092076d626102e052facc9f63f0d5c0ba686e 100644 --- a/openbis_api/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/Code.java +++ b/openbis_api/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/Code.java @@ -115,6 +115,19 @@ public class Code<T extends Code<T>> implements Serializable, ICodeHolder, Compa return codes; } + public final static List<String> extractCodes(ICodeHolder[] codeProviders) + { + List<String> codes = new ArrayList<String>(); + if (codeProviders != null) + { + for (ICodeHolder codeProvider : codeProviders) + { + codes.add(codeProvider.getCode()); + } + } + return codes; + } + public final static String[] extractCodesToArray(Collection<? extends ICodeHolder> codeProviders) { int size = (codeProviders == null) ? 0 : codeProviders.size();