(Object o)
| 321 | |
| 322 | // -------- utilities -------- |
| 323 | private static int toInt(Object o) { |
| 324 | if (o instanceof Integer) return (Integer) o; |
| 325 | if (o instanceof Long) return ((Long) o).intValue(); |
| 326 | if (o instanceof String) return Integer.parseInt(((String) o).trim()); |
| 327 | throw new IllegalArgumentException("Cannot convert to int: " + o); |
| 328 | } |
| 329 | |
| 330 | private static String leftPad(String s, int size, char ch) { |
| 331 | if (s.length() >= size) return s; |