Example usage for org.apache.commons.collections15 ExtendedCollectionUtils collectToList

List of usage examples for org.apache.commons.collections15 ExtendedCollectionUtils collectToList

Introduction

In this page you can find the example usage for org.apache.commons.collections15 ExtendedCollectionUtils collectToList.

Prototype

public static final <I, O> List<O> collectToList(Collection<? extends I> inputCollection,
            Transformer<? super I, ? extends O> transformer) 

Source Link

Usage

From source file:org.springframework.util.ExtendedPlaceholderResolverUtils.java

public static final NamedExtendedPlaceholderResolver toPlaceholderResolver(final Properties props) {
    if (ExtendedMapUtils.isEmpty(props)) {
        return EMPTY_RESOLVER;
    } else {//from ww  w .j a  va  2s  .  c o  m

        return new NamedExtendedPlaceholderResolver() {
            @Override
            public Collection<String> getPlaceholderNames() {
                return ExtendedCollectionUtils.collectToList(props.keySet(),
                        ExtendedStringUtils.SAFE_TOSTRING_XFORMER);
            }

            @Override
            public String resolvePlaceholder(String placeholderName) {
                return props.getProperty(placeholderName);
            }

            @Override
            public String resolvePlaceholder(String placeholderName, String defaultValue) {
                return props.getProperty(placeholderName, defaultValue);
            }
        };
    }
}