/** * Take an array of anything and turn it into a string * * @param array any array * @return a string representing that array */ public static String arrayToString(Object[] array) { return ArrayUtils.arrayToString(array); }
/** * Checks to see if an array contains a value, * will return false if a null value is supplied * * @param <T> * @param array any array of objects * @param value the value to check for * @return true if the value is found, false otherwise */ public static <T> boolean contains(T[] array, T value) { return ArrayUtils.contains(array, value); }
/** * Append an item to the end of an array and return the new array * * @param array an array of items * @param value the item to append to the end of the new array * @return a new array with value in the last spot */ public static <T> T[] appendArray(T[] array, T value) { return ArrayUtils.appendArray(array, value); }
indexedObject = ArrayUtils.create(type, index+1); } else { // List int length = ArrayUtils.size((Object[])indexedObject); if (index >= length) { indexedObject = ArrayUtils.resize((Object[])indexedObject, index+1); Class<?> componentType = ArrayUtils.type((Object[])indexedObject); Object convert = ReflectUtils.getInstance().convert(value, componentType); Array.set(indexedObject, index, convert);
Class<?> componentType = ArrayUtils.type((Object[])indexedObject); Object convert = ReflectUtils.getInstance().convert(value, componentType); Array.set(indexedObject, index, convert);
/** * Deep copies one object into another, this is primarily for copying between identical types of objects but * it can also handle copying between objects which are quite different, * this does not just do a reference copy of the values but actually creates new objects in the current classloader * * @param orig the original object to copy from * @param dest the object to copy the values to (must have the same fields with the same types) * @param maxDepth the number of objects to follow when traveling through the object and copying * the values from it, 0 means to only copy the simple values in the object, any objects will * be ignored and will end up as nulls, 1 means to follow the first objects found and copy all * of their simple values as well, and so forth * @param fieldNamesToSkip (optional) the names of fields to skip while cloning this object, * this only has an effect on the bottom level of the object, any fields found * on child objects will always be copied (if the maxDepth allows) * @param ignoreNulls if true then nulls are not copied and the destination retains the value it has, * if false then nulls are copied and the destination value will become a null if the original value is a null * @throws IllegalArgumentException if the copy cannot be completed because the objects to copy do not have matching fields or types */ public void deepCopy(Object orig, Object dest, int maxDepth, String[] fieldNamesToSkip, boolean ignoreNulls) { Set<String> skip = ArrayUtils.makeSetFromArray(fieldNamesToSkip); internalDeepCopy(orig, dest, maxDepth, skip, ignoreNulls, true); }
Collections.sort(constructors, new MemberComparator()); ArrayUtils.removeDuplicates(interfaces);
@Override public void setInterceptorNames(String[] interceptorNames) { if (spring12x) { this.interceptorNames = ArrayUtils.copy(interceptorNames); } else { super.setInterceptorNames(interceptorNames); } }
indexedObject = ArrayUtils.create(type, index+1); } else { // List int length = ArrayUtils.size((Object[])indexedObject); if (index >= length) { indexedObject = ArrayUtils.resize((Object[])indexedObject, index+1); Class<?> componentType = ArrayUtils.type((Object[])indexedObject); Object convert = ReflectUtils.getInstance().convert(value, componentType); Array.set(indexedObject, index, convert);
Class<?> componentType = ArrayUtils.type((Object[])indexedObject); Object convert = ReflectUtils.getInstance().convert(value, componentType); Array.set(indexedObject, index, convert);
/** * Deep copies one object into another, this is primarily for copying between identical types of objects but * it can also handle copying between objects which are quite different, * this does not just do a reference copy of the values but actually creates new objects in the current classloader * * @param orig the original object to copy from * @param dest the object to copy the values to (must have the same fields with the same types) * @param maxDepth the number of objects to follow when traveling through the object and copying * the values from it, 0 means to only copy the simple values in the object, any objects will * be ignored and will end up as nulls, 1 means to follow the first objects found and copy all * of their simple values as well, and so forth * @param fieldNamesToSkip (optional) the names of fields to skip while cloning this object, * this only has an effect on the bottom level of the object, any fields found * on child objects will always be copied (if the maxDepth allows) * @param ignoreNulls if true then nulls are not copied and the destination retains the value it has, * if false then nulls are copied and the destination value will become a null if the original value is a null * @throws IllegalArgumentException if the copy cannot be completed because the objects to copy do not have matching fields or types */ public void deepCopy(Object orig, Object dest, int maxDepth, String[] fieldNamesToSkip, boolean ignoreNulls) { Set<String> skip = ArrayUtils.makeSetFromArray(fieldNamesToSkip); internalDeepCopy(orig, dest, maxDepth, skip, ignoreNulls, true); }
Collections.sort(constructors, new MemberComparator()); ArrayUtils.removeDuplicates(interfaces);
/** * Take an array of anything and turn it into a string * * @param array any array * @return a string representing that array */ public static String arrayToString(Object[] array) { return ArrayUtils.arrayToString(array); }
/** * Checks to see if an array contains a value, * will return false if a null value is supplied * * @param <T> * @param array any array of objects * @param value the value to check for * @return true if the value is found, false otherwise */ public static <T> boolean contains(T[] array, T value) { return ArrayUtils.contains(array, value); }
} else if (ConstructorUtils.isClassArray(entityType)) { sb.append(" <type>array</type>\n"); sb.append(" <componentType>"+ArrayUtils.type((Object[])entity).getName()+"</componentType>\n"); } else if (ConstructorUtils.isClassMap(entityType)) { sb.append(" <type>map</type>\n"); sb.append( makeResolveType("collection", null, locale)); } else if (ConstructorUtils.isClassArray(entityType)) { String cType = "Component Class: " + ArrayUtils.type((Object[])entity).getName(); sb.append( makeResolveType("array", cType, locale)); } else if (ConstructorUtils.isClassMap(entityType)) {