Package io.microsphere.util
Class IterableUtils
- java.lang.Object
-
- io.microsphere.util.IterableUtils
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
isIterable(java.lang.Class<?> clazz)
Checks if the given class is assignable fromIterable
.static boolean
isIterable(java.lang.Object object)
Checks if the given object is an instance ofIterable
.
-
-
-
Method Detail
-
isIterable
public static boolean isIterable(@Nullable java.lang.Object object)
Checks if the given object is an instance ofIterable
.Example Usage
List<String> list = Arrays.asList("a", "b", "c"); boolean result1 = IterableUtils.isIterable(list); // true boolean result2 = IterableUtils.isIterable("string"); // false boolean result3 = IterableUtils.isIterable(null); // false
- Parameters:
object
- the object to check- Returns:
true
if the object is an instance ofIterable
,false
otherwise
-
isIterable
public static boolean isIterable(@Nullable java.lang.Class<?> clazz)
Checks if the given class is assignable fromIterable
.Example Usage
boolean result1 = IterableUtils.isIterable(List.class); // true boolean result2 = IterableUtils.isIterable(String.class); // false boolean result3 = IterableUtils.isIterable(null); // false
- Parameters:
clazz
- the class to check- Returns:
true
if the class is assignable fromIterable
,false
otherwise- See Also:
ClassUtils.isAssignableFrom(Class, Class)
-
-