public static String implodeObjects ( Iterable < ? > objects ) { StringBuilder builder = new StringBuilder ( ) ; boolean first = true ; for ( Object o : objects ) { if ( first ) { first = false ; } else { builder . append ( "|" ) ; } builder . append ( o . toString ( ) ) ; } return builder . toString ( ) ; }
Builds a string that serializes a list of objects separated by the pipe character . The toString methods are used to turn objects into strings . This operation is commonly used to build parameter lists for API requests .