Author: doogie
Date: Mon Jun 30 13:41:20 2008
New Revision: 672903
URL:
http://svn.apache.org/viewvc?rev=672903&view=revLog:
Add checkStack variants.
Modified:
ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilGenerics.java
Modified: ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilGenerics.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilGenerics.java?rev=672903&r1=672902&r2=672903&view=diff==============================================================================
--- ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilGenerics.java (original)
+++ ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilGenerics.java Mon Jun 30 13:41:20 2008
@@ -22,6 +22,7 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.Stack;
import javolution.util.FastMap;
@@ -96,6 +97,16 @@
}
@SuppressWarnings("unchecked")
+ public static <T> Stack<T> checkStack(Object object) {
+ return (Stack<T>) checkCollectionCast(object, Stack.class);
+ }
+
+ public static <T> Stack<T> checkStack(Object object, Class<T> type) {
+ checkCollectionContainment(object, Stack.class, type);
+ return checkStack(object);
+ }
+
+ @SuppressWarnings("unchecked")
public static <T> Set<T> checkSet(Object object) {
return (Set<T>) checkCollectionCast(object, Set.class);
}