@Test public void testGetArgAsStringFromBoolean2() { assertEquals("getArgAsString failed!", "FALSE", FunctionUtil.getArgAsString(Boolean.valueOf(false))); }
public static String getArgAsString(final Object arg) throws IllegalArgumentException { if (arg.getClass() == Boolean.class) return (Boolean)arg ? "TRUE" : "FALSE"; if (arg.getClass() == Double.class) { final String asString = arg.toString(); int length = asString.length(); while (length > 1 && asString.charAt(length - 1) == '0') --length; if (asString.charAt(length - 1) == '.' || asString.charAt(length - 1) == ',') --length; return asString.substring(0, length); } return arg.toString(); }
FunctionUtil { public static String getArgAsString(final Object arg) throws IllegalArgumentException { if (arg.getClass() == Boolean.class) return (Boolean)arg ? "TRUE" : "FALSE"; if (arg.getClass() == Double.class) { final String asString = arg.toString(); int length = asString.length(); while (length > 1 && asString.charAt(length - 1) == '0') --length; if (asString.charAt(length - 1) == '.' || asString.charAt(length - 1) == ',') --length; return asString.substring(0, length); } return arg.toString(); } }
FunctionUtil { public static String getArgAsString(final Object arg) throws IllegalArgumentException { if (arg.getClass() == Boolean.class) return (Boolean)arg ? "TRUE" : "FALSE"; if (arg.getClass() == Double.class) { final String asString = arg.toString(); int length = asString.length(); while (length > 1 && asString.charAt(length - 1) == '0') --length; if (asString.charAt(length - 1) == '.' || asString.charAt(length - 1) == ',') --length; return asString.substring(0, length); } return arg.toString(); } private  FunctionUtil(); }
FunctionUtil { public static String getArgAsString(final Object arg) throws IllegalArgumentException { if (arg.getClass() == Boolean.class) return (Boolean)arg ? "TRUE" : "FALSE"; if (arg.getClass() == Double.class) { final String asString = arg.toString(); int length = asString.length(); while (length > 1 && asString.charAt(length - 1) == '0') --length; if (asString.charAt(length - 1) == '.' || asString.charAt(length - 1) == ',') --length; return asString.substring(0, length); } return arg.toString(); } 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 String getArgAsString(final Object arg) throws IllegalArgumentException { if (arg.getClass() == Boolean.class) return (Boolean)arg ? "TRUE" : "FALSE"; if (arg.getClass() == Double.class) { final String asString = arg.toString(); int length = asString.length(); while (length > 1 && asString.charAt(length - 1) == '0') --length; if (asString.charAt(length - 1) == '.' || asString.charAt(length - 1) == ',') --length; return asString.substring(0, length); } return arg.toString(); } 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);  }