(Object value)
| 445 | } |
| 446 | |
| 447 | public static int getArrayLength(Object value) { |
| 448 | if (value == null) return 0; |
| 449 | |
| 450 | if (value instanceof List<?>) { |
| 451 | return ((List<?>) value).size(); |
| 452 | } else if (value instanceof String) { |
| 453 | return ((String) value).length(); // fallback |
| 454 | } else if (value.getClass().isArray()) { |
| 455 | return java.lang.reflect.Array.getLength(value); |
| 456 | } else { |
| 457 | return 0; |
| 458 | } |
| 459 | } |
| 460 | |
| 461 | public static boolean IsInteger(Object value) { |
| 462 | if (value == null) return false; |