/** * <p> * Java-escapes all the elements in the target array. * </p> * * @param target the array of Strings to be escaped. * If non-String objects, toString() will be called. * * @return a String[] with the result of each * each element of the target. * * @since 2.0.11 * */ public String[] arrayEscapeJava(final Object[] target) { if (target == null) { return null; } final String[] result = new String[target.length]; for (int i = 0; i < target.length; i++) { result[i] = escapeJava(target[i]); } return result; }
/** * <p> * Java-escapes all the elements in the target list. * </p> * * @param target the list of Strings to be escaped. * If non-String objects, toString() will be called. * * @return a List with the result of each * each element of the target. * * @since 2.0.11 * */ public List<String> listEscapeJava(final List<?> target) { if (target == null) { return null; } final List<String> result = new ArrayList<String>(target.size() + 2); for (final Object element : target) { result.add(escapeJava(element)); } return result; }
/** * <p> * Java-escapes all the elements in the target set. * </p> * * @param target the list of Strings to be escaped. * If non-String objects, toString() will be called. * * @return a Set with the result of each * each element of the target. * * @since 2.0.11 * */ public Set<String> setEscapeJava(final Set<?> target) { if (target == null) { return null; } final Set<String> result = new LinkedHashSet<String>(target.size() + 2); for (final Object element : target) { result.add(escapeJava(element)); } return result; }
/** * <p> * Java-escapes all the elements in the target array. * </p> * * @param target the array of Strings to be escaped. * If non-String objects, toString() will be called. * * @return a String[] with the result of each * each element of the target. * * @since 2.0.11 * */ public String[] arrayEscapeJava(final Object[] target) { if (target == null) { return null; } final String[] result = new String[target.length]; for (int i = 0; i < target.length; i++) { result[i] = escapeJava(target[i]); } return result; }
/** * <p> * Java-escapes all the elements in the target list. * </p> * * @param target the list of Strings to be escaped. * If non-String objects, toString() will be called. * * @return a List with the result of each * each element of the target. * * @since 2.0.11 * */ public List<String> listEscapeJava(final List<?> target) { if (target == null) { return null; } final List<String> result = new ArrayList<String>(target.size() + 2); for (final Object element : target) { result.add(escapeJava(element)); } return result; }
/** * <p> * Java-escapes all the elements in the target set. * </p> * * @param target the list of Strings to be escaped. * If non-String objects, toString() will be called. * * @return a Set with the result of each * each element of the target. * * @since 2.0.11 * */ public Set<String> setEscapeJava(final Set<?> target) { if (target == null) { return null; } final Set<String> result = new LinkedHashSet<String>(target.size() + 2); for (final Object element : target) { result.add(escapeJava(element)); } return result; }