Example usage for org.apache.commons.collections.functors StringValueTransformer INSTANCE

List of usage examples for org.apache.commons.collections.functors StringValueTransformer INSTANCE

Introduction

In this page you can find the example usage for org.apache.commons.collections.functors StringValueTransformer INSTANCE.

Prototype

Transformer INSTANCE

To view the source code for org.apache.commons.collections.functors StringValueTransformer INSTANCE.

Click Source Link

Document

Singleton predicate instance

Usage

From source file:com.sworddance.util.TestPredicatedTransformingIterator.java

public void testSimpleTransform() {
    PredicatedTransformingIterator<String> transformingIterator = new PredicatedTransformingIterator<String>(
            ints);/*w ww  .  j a v  a2 s . com*/
    transformingIterator.setTransformer(StringValueTransformer.INSTANCE);
    int j = 0;
    for (String i : transformingIterator) {
        assertEquals(Integer.toString(j++), i);
    }
    assertEquals(ints.size(), j);
}

From source file:com.projity.functor.StringList.java

/**
 * Utility function to dump out a collection separated by ,
 * @param collection/*from w w w. j  a  v  a2s .c  o m*/
 * @return
 */
public static String list(Collection collection) {
    return list(collection, StringValueTransformer.INSTANCE);
}

From source file:com.projity.functor.StringList.java

private StringList() {
    this(StringValueTransformer.INSTANCE);
}

From source file:com.projity.functor.StringList.java

public static String commaSeparatedList(Collection collection) {
    StringList l = getInstance(StringValueTransformer.INSTANCE);
    l.setSeparator(",");
    CollectionUtils.forAllDo(collection, l);
    return l.toString();
}

From source file:com.projity.functor.StringList.java

public static String brSeparatedList(Collection collection) {
    StringList l = getInstance(StringValueTransformer.INSTANCE);
    l.setSeparator("<br>");
    CollectionUtils.forAllDo(collection, l);
    return l.toString();
}