private Splittable collectionEncode(Collection<?> collection) { StringBuilder sb = new StringBuilder("["); Iterator<?> it = collection.iterator(); if (it.hasNext()) { // TODO: Allow for the encoding of nested collections. See issue 5974. sb.append(nonCollectionEncode(it.next()).getPayload()); while (it.hasNext()) { sb.append(","); // TODO: Allow for the encoding of nested collections. See issue 5974. sb.append(nonCollectionEncode(it.next()).getPayload()); } } sb.append("]"); return StringQuoter.split(sb.toString()); }
private Splittable collectionEncode(Collection<?> collection) { StringBuilder sb = new StringBuilder("["); Iterator<?> it = collection.iterator(); if (it.hasNext()) { // TODO: Allow for the encoding of nested collections. See issue 5974. sb.append(nonCollectionEncode(it.next()).getPayload()); while (it.hasNext()) { sb.append(","); // TODO: Allow for the encoding of nested collections. See issue 5974. sb.append(nonCollectionEncode(it.next()).getPayload()); } } sb.append("]"); return StringQuoter.split(sb.toString()); }
private Splittable collectionEncode(Collection<?> collection) { StringBuilder sb = new StringBuilder("["); Iterator<?> it = collection.iterator(); if (it.hasNext()) { // TODO: Allow for the encoding of nested collections. See issue 5974. sb.append(nonCollectionEncode(it.next()).getPayload()); while (it.hasNext()) { sb.append(","); // TODO: Allow for the encoding of nested collections. See issue 5974. sb.append(nonCollectionEncode(it.next()).getPayload()); } } sb.append("]"); return StringQuoter.split(sb.toString()); }
private Splittable collectionEncode(Collection<?> collection) { StringBuilder sb = new StringBuilder("["); Iterator<?> it = collection.iterator(); if (it.hasNext()) { // TODO: Allow for the encoding of nested collections. See issue 5974. sb.append(nonCollectionEncode(it.next()).getPayload()); while (it.hasNext()) { sb.append(","); // TODO: Allow for the encoding of nested collections. See issue 5974. sb.append(nonCollectionEncode(it.next()).getPayload()); } } sb.append("]"); return StringQuoter.split(sb.toString()); }
Splittable encode(Object obj) { if (obj == null) { return Splittable.NULL; } else if (obj instanceof Collection) { return collectionEncode((Collection<?>) obj); } return nonCollectionEncode(obj); }
Splittable encode(Object obj) { if (obj == null) { return Splittable.NULL; } else if (obj instanceof Collection) { return collectionEncode((Collection<?>) obj); } return nonCollectionEncode(obj); }
Splittable encode(Object obj) { if (obj == null) { return Splittable.NULL; } else if (obj instanceof Collection) { return collectionEncode((Collection<?>) obj); } return nonCollectionEncode(obj); }
Splittable encode(Object obj) { if (obj == null) { return Splittable.NULL; } else if (obj instanceof Collection) { return collectionEncode((Collection<?>) obj); } return nonCollectionEncode(obj); }