if (clazz.isAssignableFrom(obj.getClass())) { return obj; } else { if (String.class.isAssignableFrom(clazz)) { return obj.toString(); else if (Integer.class.isAssignableFrom(clazz)) { if (obj instanceof String) { ...
byte[] primitives = new byte[array.length]; for (int i = 0; i < array.length; i++) primitives[i] = (byte) (Byte) array[i]; return primitives;
Creates a byte-based String representation of a raw byte array representing the value of the objectGUID attribute retrieved from Active Directory.
The returned string is useful to perform queries on AD based on the objectGUID value.
StringBuilder result = new StringBuilder(); for (int i = 0; i < objectGUID.length; i++) { String transformed = prefixZeros((int) objectGUID[i] & 0xFF); result.append("\\"); result.append(transformed); return result.toString();
if (obj != null && clazz.isInstance(obj)) { return (T) obj; return null;
if (value != null) { if (value instanceof Boolean) { return ((Boolean) value).booleanValue(); } else { return Boolean.valueOf(value.toString()).booleanValue(); } else { throw new IllegalArgumentException("Property value was null so it couldn't be converted to a boolean."); ...
if (value != null) { if (value instanceof Integer) { return ((Integer) value).intValue(); } else { return Integer.valueOf(value.toString()).intValue(); } else { throw new NullPointerException("Property value was null so it couldn't be converted to an int."); ...
if (configValue instanceof String) { return Integer.valueOf((String) configValue); return configValue;
String valuesSql = "''"; if (value != null) { if (value instanceof String) { valuesSql = "'" + ((String) value).replaceAll("'", "''") + "'"; } else if (value instanceof Boolean) { valuesSql = "" + ((Boolean) value ? 1 : 0); } else { valuesSql = value.toString(); ...
int[] returnInt = new int[objectArray.length]; for (int i = 0; i < objectArray.length; i++) { returnInt[i] = (Integer) objectArray[i]; return returnInt;
Object[] array = new Object[objArray.length]; int i = 0; for (Object obj : objArray) { array[i++] = obj; return array;