jodd-bean/src/main/java/jodd/typeconverter/impl/LongArrayConverter.java
protected long[] convertPrimitiveArrayToArray(final Object value, final Class primitiveComponentType) {
		long[] result = null;

		if (primitiveComponentType == long.class) {
			return (long[]) value;
		}

		if (primitiveComponentType == int.class) {
			final int[] array = (int[]) value;
			result = new long[array.length];
			for (int i = 0; i < array.length; i++) {
				result[i] = array[i];
			}
		}
		else if (primitiveComponentType == float.class) {
			final float[] array = (float[]) value;
			result = new long[array.length];
			for (int i = 0; i < array.length; i++) {
				result[i] = (long) array[i];
			}
		}
		else if (primitiveComponentType == double.class) {
			final double[] array = (double[]) value;
			result = new long[array.length];
			for (int i = 0; i < array.length; i++) {
				result[i] = (long) array[i];
			}
		}
		else if (primitiveComponentType == short.class) {
			final short[] array = (short[]) value;
			result = new long[array.length];
			for (int i = 0; i < array.length; i++) {
				result[i] = array[i];
			}
		}
		else if (primitiveComponentType == byte.class) {
			final byte[] array = (byte[]) value;
			result = new long[array.length];
			for (int i = 0; i < array.length; i++) {
				result[i] = array[i];
			}
		}
		else if (primitiveComponentType == char.class) {
			final char[] array = (char[]) value;
			result = new long[array.length];
			for (int i = 0; i < array.length; i++) {
				result[i] = array[i];
			}
		}
		else if (primitiveComponentType == boolean.class) {
			final boolean[] array = (boolean[]) value;
			result = new long[array.length];
			for (int i = 0; i < array.length; i++) {
				result[i] = array[i] ? 1 : 0;
			}
		}
		return result;
	}
protected long[] convertPrimitiveArrayToArray(final Object value, final Class primitiveComponentType) {
		long[] result = null;

		if (primitiveComponentType == long.class) {
			return (long[]) value;
		}

		if (primitiveComponentType == int.class) {
			final int[] array = (int[]) value;
			result = new long[array.length];
			for (int i = 0; i < array.length; i++) {
				result[i] = array[i];
			}
		}
		else if (primitiveComponentType == float.class) {
			final float[] array = (float[]) value;
			result = new long[array.length];
			for (int i = 0; i < array.length; i++) {
				result[i] = (long) array[i];
			}
		}
		else if (primitiveComponentType == double.class) {
			final double[] array = (double[]) value;
			result = new long[array.length];
			for (int i = 0; i < array.length; i++) {
				result[i] = (long) array[i];
			}
		}
		else if (primitiveComponentType == short.class) {
			final short[] array = (short[]) value;
			result = new long[array.length];
			for (int i = 0; i < array.length; i++) {
				result[i] = array[i];
			}
		}
		else if (primitiveComponentType == byte.class) {
			final byte[] array = (byte[]) value;
			result = new long[array.length];
			for (int i = 0; i < array.length; i++) {
				result[i] = array[i];
			}
		}
		else if (primitiveComponentType == char.class) {
			final char[] array = (char[]) value;
			result = new long[array.length];
			for (int i = 0; i < array.length; i++) {
				result[i] = array[i];
			}
		}
		else if (primitiveComponentType == boolean.class) {
			final boolean[] array = (boolean[]) value;
			result = new long[array.length];
			for (int i = 0; i < array.length; i++) {
				result[i] = array[i] ? 1 : 0;
			}
		}
		return result;
	}
protected long [ ] convertPrimitiveArrayToArray ( final Object value , final Class primitiveComponentType ) { long [ ] result = null ; if ( primitiveComponentType == long . class ) { return ( long [ ] ) value ; } if ( primitiveComponentType == int . class ) { final int [ ] array = ( int [ ] ) value ; result = new long [ array . length ] ; for ( int i = 0 ; i < array . length ; i ++ ) { result [ i ] = array [ i ] ; } } else if ( primitiveComponentType == float . class ) { final float [ ] array = ( float [ ] ) value ; result = new long [ array . length ] ; for ( int i = 0 ; i < array . length ; i ++ ) { result [ i ] = ( long ) array [ i ] ; } } else if ( primitiveComponentType == double . class ) { final double [ ] array = ( double [ ] ) value ; result = new long [ array . length ] ; for ( int i = 0 ; i < array . length ; i ++ ) { result [ i ] = ( long ) array [ i ] ; } } else if ( primitiveComponentType == short . class ) { final short [ ] array = ( short [ ] ) value ; result = new long [ array . length ] ; for ( int i = 0 ; i < array . length ; i ++ ) { result [ i ] = array [ i ] ; } } else if ( primitiveComponentType == byte . class ) { final byte [ ] array = ( byte [ ] ) value ; result = new long [ array . length ] ; for ( int i = 0 ; i < array . length ; i ++ ) { result [ i ] = array [ i ] ; } } else if ( primitiveComponentType == char . class ) { final char [ ] array = ( char [ ] ) value ; result = new long [ array . length ] ; for ( int i = 0 ; i < array . length ; i ++ ) { result [ i ] = array [ i ] ; } } else if ( primitiveComponentType == boolean . class ) { final boolean [ ] array = ( boolean [ ] ) value ; result = new long [ array . length ] ; for ( int i = 0 ; i < array . length ; i ++ ) { result [ i ] = array [ i ] ? 1 : 0 ; } } return result ; }
Converts primitive array to target array.
Converts primitive array to target array .