/** * Returns the string representation of the given array. * * @param self an array * @return the string representation * @since 1.6.0 */ public static String toString(byte[] self) { return InvokerHelper.toString(self); }
/** * Returns the string representation of the given array. * * @param self an array * @return the string representation * @since 1.6.0 */ public static String toString(long[] self) { return InvokerHelper.toString(self); }
/** * Returns the string representation of the given array. * * @param self an array * @return the string representation * @since 1.6.0 */ public static String toString(float[] self) { return InvokerHelper.toString(self); }
/** * Returns the string representation of the given array. * * @param self an array * @return the string representation * @since 1.6.0 */ public static String toString(boolean[] self) { return InvokerHelper.toString(self); }
/** * Returns the string representation of the given array. * * @param self an array * @return the string representation * @since 1.6.0 */ public static String toString(short[] self) { return InvokerHelper.toString(self); }
/** * Returns the string representation of the given array. * * @param self an array * @return the string representation * @since 1.6.0 */ public static String toString(char[] self) { return InvokerHelper.toString(self); }
/** * Returns the string representation of the given array. * * @param self an array * @return the string representation * @since 1.6.0 */ public static String toString(int[] self) { return InvokerHelper.toString(self); }
/** * Print a value formatted Groovy style to the print writer. * * @param self a PrintWriter * @param value the value to print * @since 1.0 */ public static void print(PrintWriter self, Object value) { self.print(InvokerHelper.toString(value)); }
/** * Print a value formatted Groovy style to the print stream. * * @param self a PrintStream * @param value the value to print * @since 1.6.0 */ public static void print(PrintStream self, Object value) { self.print(InvokerHelper.toString(value)); }
/** * Print a value formatted Groovy style (followed by a newline) to the print writer. * * @param self a PrintWriter * @param value the value to print * @since 1.0 */ public static void println(PrintWriter self, Object value) { self.println(InvokerHelper.toString(value)); }
/** * Print a value formatted Groovy style (followed by a newline) to the print stream. * * @param self any Object * @param value the value to print * @since 1.6.0 */ public static void println(PrintStream self, Object value) { self.println(InvokerHelper.toString(value)); }
protected static String createErrorMessageForAmbiguity(String theClassName, String name, Class[] arguments, LinkedList matches) { StringBuilder msg = new StringBuilder("Ambiguous method overloading for method "); msg.append(theClassName).append("#").append(name) .append(".\nCannot resolve which method to invoke for ") .append(InvokerHelper.toString(arguments)) .append(" due to overlapping prototypes between:"); for (final Object match : matches) { CachedClass[] types = ((ParameterTypes) match).getParameterTypes(); msg.append("\n\t").append(InvokerHelper.toString(types)); } return msg.toString(); }
/** * Prints an object Groovy style. * * @param obj The <code>Object</code> to be printed */ public void print(Object obj) { print(InvokerHelper.toString(obj)); }
public void println(Object x) { // JDK 1.6 has changed the implementation to do a // String.valueOf(x) rather than call print(x). // Probably to improve performance by doing the conversion outside the lock. // This will do the same thing for us, and we don't have to have access to the lock. println(InvokerHelper.toString(x)); } }
/** * Prints an object Groovy style followed by a newline. * * @param obj The <code>Object</code> to be printed */ public void println(Object obj) { println(InvokerHelper.toString(obj)); }
protected void printSimpleItem(Object value) { if (!preserveWhitespace) printLineBegin(); printEscaped(InvokerHelper.toString(value), false); if (!preserveWhitespace) printLineEnd(); }
protected void printSimpleItem(Object value) { this.printLineBegin(); out.print(escapeSpecialChars(InvokerHelper.toString(value))); printLineEnd(); }
protected void assertConstructor(Object expected, Object arguments) throws Throwable { Object value = invoke(expected.getClass(), arguments); assertEquals("Invoking overloaded method for arguments: " + InvokerHelper.toString(arguments), expected, value); }
/** * Asserts that invoking the method chooser finds the right overloaded * method implementation * * @param expected is the expected value of the method * @param arguments the argument(s) to the method invocation */ protected void assertMethodChooser(Object expected, Object arguments) throws Throwable { Object value = invoke(this, "mockOverloadedMethod", arguments); assertEquals("Invoking overloaded method for arguments: " + InvokerHelper.toString(arguments), expected, value); }
public void testAppendString2() { DummyGString a = new DummyGString(new Object[]{"James"}, new String[]{"Hello "}); GString result = a.plus(" how are you?"); System.out.println("Strings: " + InvokerHelper.toString(result.getStrings())); System.out.println("Values: " + InvokerHelper.toString(result.getValues())); assertEquals("Hello James how are you?", result.toString()); }