private Collection< ? > toCollection(Object o) { if (o instanceof Collection) return (Collection< ? >) o; if (o.getClass().isArray()) { if (o.getClass().getComponentType().isPrimitive()) { int length = Array.getLength(o); List<Object> result = new ArrayList<Object>(length); for (int i = 0; i < length; i++) { result.add(Array.get(o, i)); } return result; } return Arrays.asList((Object[]) o); } if (o instanceof String) { String s = (String) o; if (SPLITTER_P.matcher(s).find()) return Arrays.asList(s.split("\\|")); else return unescape(s); } return Arrays.asList(o); }
private Collection< ? > toCollection(Object o) { if (o instanceof Collection) return (Collection< ? >) o; if (o.getClass().isArray()) { if (o.getClass().getComponentType().isPrimitive()) { int length = Array.getLength(o); List<Object> result = new ArrayList<Object>(length); for (int i = 0; i < length; i++) { result.add(Array.get(o, i)); } return result; } return Arrays.asList((Object[]) o); } if (o instanceof String) { String s = (String) o; if (SPLITTER_P.matcher(s).find()) return Arrays.asList(s.split("\\|")); else return unescape(s); } return Arrays.asList(o); }
private Collection<?> toCollection(Object o) { if (o instanceof Collection) return (Collection<?>) o; if (o.getClass() .isArray()) { if (o.getClass() .getComponentType() .isPrimitive()) { int length = Array.getLength(o); List<Object> result = new ArrayList<>(length); for (int i = 0; i < length; i++) { result.add(Array.get(o, i)); } return result; } return Arrays.asList((Object[]) o); } if (o instanceof String) { String s = (String) o; if (SPLITTER_P.matcher(s) .find()) return Arrays.asList(s.split("\\|")); else return unescape(s); } return Arrays.asList(o); }
private Collection< ? > toCollection(Object o) { if (o instanceof Collection) return (Collection< ? >) o; if (o.getClass().isArray()) { if (o.getClass().getComponentType().isPrimitive()) { int length = Array.getLength(o); List<Object> result = new ArrayList<Object>(length); for (int i = 0; i < length; i++) { result.add(Array.get(o, i)); } return result; } return Arrays.asList((Object[]) o); } if (o instanceof String) { String s = (String) o; if (SPLITTER_P.matcher(s).find()) return Arrays.asList(s.split("\\|")); else return unescape(s); } return Arrays.asList(o); }
private Collection<?> toCollection(Object o) { if (o instanceof Collection) return (Collection<?>) o; if (o.getClass() .isArray()) { if (o.getClass() .getComponentType() .isPrimitive()) { int length = Array.getLength(o); List<Object> result = new ArrayList<>(length); for (int i = 0; i < length; i++) { result.add(Array.get(o, i)); } return result; } return Arrays.asList((Object[]) o); } if (o instanceof String) { String s = (String) o; if (SPLITTER_P.matcher(s) .find()) return Arrays.asList(s.split("\\|")); else return unescape(s); } return Arrays.asList(o); }
private Collection<?> toCollection(Object o) { if (o instanceof Collection) return (Collection<?>) o; if (o.getClass() .isArray()) { if (o.getClass() .getComponentType() .isPrimitive()) { int length = Array.getLength(o); List<Object> result = new ArrayList<>(length); for (int i = 0; i < length; i++) { result.add(Array.get(o, i)); } return result; } return Arrays.asList((Object[]) o); } if (o instanceof String) { String s = (String) o; if (SPLITTER_P.matcher(s) .find()) return Arrays.asList(s.split("\\|")); else return unescape(s); } return Arrays.asList(o); }