@Test public void testTranslateObjectType7() { assertEquals("translateObjectType() failed!", 2L, FunctionUtil.translateObjectType(Short.valueOf("2"))); }
public static Object translateObjectType(final Object input) { final Class<?> type = input.getClass(); if (type == Double.class || type == Long.class || type == Boolean.class || type == String.class) return input; if (type == Float.class) return Double.valueOf((Float)input); if (type == Integer.class) return Long.valueOf((Integer)input); if (type == Short.class) return Long.valueOf((Short)input); if (type == Byte.class) return Long.valueOf((Byte)input); if (type == Character.class) return Long.valueOf((Character)input); return null; }
FunctionUtil { public static Object translateObjectType(final Object input) { final Class<?> type = input.getClass(); if (type == Double.class || type == Long.class || type == Boolean.class || type == String.class) return input; if (type == Float.class) return Double.valueOf((Float)input); if (type == Integer.class) return Long.valueOf((Integer)input); if (type == Short.class) return Long.valueOf((Short)input); if (type == Byte.class) return Long.valueOf((Byte)input); if (type == Character.class) return Long.valueOf((Character)input); return null; } }
FunctionUtil { public static Object translateObjectType(final Object input) { final Class<?> type = input.getClass(); if (type == Double.class || type == Long.class || type == Boolean.class || type == String.class) return input; if (type == Float.class) return Double.valueOf((Float)input); if (type == Integer.class) return Long.valueOf((Integer)input); if (type == Short.class) return Long.valueOf((Short)input); if (type == Byte.class) return Long.valueOf((Byte)input); if (type == Character.class) return Long.valueOf((Character)input); return null; } private  FunctionUtil(); }
FunctionUtil { public static Object translateObjectType(final Object input) { final Class<?> type = input.getClass(); if (type == Double.class || type == Long.class || type == Boolean.class || type == String.class) return input; if (type == Float.class) return Double.valueOf((Float)input); if (type == Integer.class) return Long.valueOf((Integer)input); if (type == Short.class) return Long.valueOf((Short)input); if (type == Byte.class) return Long.valueOf((Byte)input); if (type == Character.class) return Long.valueOf((Character)input); return null; } private  FunctionUtil(); static double getArgAsDouble(final Object arg); static String getArgAsString(final Object arg); static long getArgAsLong(final Object arg); static boolean getArgAsBoolean(final Object arg); static double numericallySafeSum(final double a[]); static String getOrdinal(final int i); static double calcSampleVariance(final double[] x); static double[] listToArray(final List<Double> a); static boolean isScalarArgType(final Class type); static boolean isTypeOfList(final Class listClassCandidate); static void addScalarArgumentTypes(final List<Class> argTypes); static double[] getDoubles(final Object[] args); static long[] getLongs(final Object[] args); static String[] getStrings(final Object[] args); static boolean[] getBooleans(final Object[] args); static Object translateObjectType(final Object input); }
FunctionUtil { public static Object translateObjectType(final Object input) { final Class<?> type = input.getClass(); if (type == Double.class || type == Long.class || type == Boolean.class || type == String.class) return input; if (type == Float.class) return Double.valueOf((Float)input); if (type == Integer.class) return Long.valueOf((Integer)input); if (type == Short.class) return Long.valueOf((Short)input); if (type == Byte.class) return Long.valueOf((Byte)input); if (type == Character.class) return Long.valueOf((Character)input); return null; } private  FunctionUtil(); static double getArgAsDouble(final Object arg); static String getArgAsString(final Object arg); static long getArgAsLong(final Object arg); static boolean getArgAsBoolean(final Object arg); static double numericallySafeSum(final double a[]); static String getOrdinal(final int i); static double calcSampleVariance(final double[] x); static double[] listToArray(final List<Double> a); static boolean isScalarArgType(final Class type); static boolean isTypeOfList(final Class listClassCandidate); static void addScalarArgumentTypes(final List<Class> argTypes); static double[] getDoubles(final Object[] args); static long[] getLongs(final Object[] args); static String[] getStrings(final Object[] args); static boolean[] getBooleans(final Object[] args); static Object translateObjectType(final Object input);  }