Gary D. Gregory created CONFIGURATION-780:
---------------------------------------------

             Summary: Add 
org.apache.commons.collections4.EnumerationUtils.asIterable(Enumeration<T>)
                 Key: CONFIGURATION-780
                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-780
             Project: Commons Configuration
          Issue Type: New Feature
            Reporter: Gary D. Gregory


Add 
{{org.apache.commons.collections4.EnumerationUtils.asIterable(Enumeration<T>)}}

{code:java}
    /**
     * Gets an {@link Iterable} that wraps an {@link Enumeration}. The returned 
{@link Iterable} can be used for a
     * single iteration.
     *
     * @param <T> the element type
     * @param enumeration the enumeration to use, may not be null
     * @return a new, single use {@link Iterable}
     * @throws NullPointerException if iterator is null
     * @since 4.5
     */
    public static <T> Iterable<T> asIterable(final Enumeration<T> enumeration) {
        return new IteratorIterable<>(new EnumerationIterator<>(enumeration));
    }
{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to