You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gary D. Gregory (Jira)" <ji...@apache.org> on 2020/01/12 15:34:00 UTC

[jira] [Resolved] (COLLECTIONS-744) Add org.apache.commons.collections4.EnumerationUtils.asIterable(Enumeration)

     [ https://issues.apache.org/jira/browse/COLLECTIONS-744?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gary D. Gregory resolved COLLECTIONS-744.
-----------------------------------------
    Fix Version/s: 4.5
       Resolution: Fixed

In git master.


> Add org.apache.commons.collections4.EnumerationUtils.asIterable(Enumeration<T>)
> -------------------------------------------------------------------------------
>
>                 Key: COLLECTIONS-744
>                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-744
>             Project: Commons Collections
>          Issue Type: New Feature
>            Reporter: Gary D. Gregory
>            Priority: Major
>             Fix For: 4.5
>
>
> 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)