org.apache.commons.collections4

## Class EnumerationUtils

- java.lang.Object
- - org.apache.commons.collections4.EnumerationUtils

-     public class EnumerationUtils
      extends Object

  Provides utility methods for `Enumeration` instances.
  Since:
    3.0
  Version:
    $Id: EnumerationUtils.java 1533984 2013-10-20 21:12:51Z tn $

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <E> List<E>` | `toList(Enumeration<? extends E> enumeration)` Creates a list based on an enumeration.
    `static List<String>` | `toList(StringTokenizer stringTokenizer)` Override toList(Enumeration) for StringTokenizer as it implements Enumeration<Object> for the sake of backward compatibility.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### toList

          public static <E> List<E> toList(Enumeration<? extends E> enumeration)

      Creates a list based on an enumeration.

      As the enumeration is traversed, an ArrayList of its values is created. The new list is returned.

      Type Parameters:
        `E` - the element type
      Parameters:
        `enumeration` - the enumeration to traverse, which should not be `null`.
      Returns:
        a list containing all elements of the given enumeration
      Throws:
        `NullPointerException` - if the enumeration parameter is `null`.

    - #### toList

          public static List<String> toList(StringTokenizer stringTokenizer)

      Override toList(Enumeration) for StringTokenizer as it implements Enumeration<Object> for the sake of backward compatibility.
      Parameters:
        `stringTokenizer` - the tokenizer to convert to a `List`<`String`>
      Returns:
        a list containing all tokens of the given StringTokenizer

Copyright © 2001–2013 The Apache Software Foundation. All rights reserved.