File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
org.springframework.core/src/main/java/org/springframework/util Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2010 the original author or authors.
2
+ * Copyright 2002-2011 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -950,6 +950,19 @@ public static String classNamesToString(Collection<Class> classes) {
950
950
return sb .toString ();
951
951
}
952
952
953
+ /**
954
+ * Copy the given Collection into a Class array.
955
+ * The Collection must contain Class elements only.
956
+ * @param collection the Collection to copy
957
+ * @return the Class array (<code>null</code> if the passed-in
958
+ * Collection was <code>null</code>)
959
+ */
960
+ public static Class <?>[] toClassArray (Collection <Class <?>> collection ) {
961
+ if (collection == null ) {
962
+ return null ;
963
+ }
964
+ return collection .toArray (new Class <?>[collection .size ()]);
965
+ }
953
966
954
967
/**
955
968
* Return all interfaces that the given instance implements as array,
You can’t perform that action at this time.
0 commit comments