Package: java.util

## [Java] Interface Enumeration

-     public interface Enumeration

  GDK enhancements for Enumeration.

  displayName:
    Enumeration
  receiverFqcn:
    java.util.Enumeration

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public boolean` | `asBoolean()` Coerce an enumeration instance to a boolean value.
    `<T>` | `public Iterator<T>` | `iterator()` Allows an Enumeration to behave like an Iterable.
    `<T>` | `public Stream<T>` | `stream()` Returns a sequential Stream with the specified element(s) as its source.
    `<T>` | `public List<T>` | `toList()` Convert an enumeration to a List.
    `<T>` | `public Set<T>` | `toSet()` Convert an enumeration to a Set.

- - ### Method Detail

    - #### public boolean asBoolean()

      Coerce an enumeration instance to a boolean value. An enumeration is coerced to false if there are no more elements to enumerate, and to true otherwise.

      Returns:
        the boolean value
      Since:
        1.7.0

    - #### <T> public Iterator<T> iterator()

      Allows an Enumeration to behave like an Iterable. Note that the Iterator.remove method is unsupported since the underlying Enumeration doesn't provide a mechanism for removing items.

      Returns:
        an Iterator for the given Enumeration
      Since:
        1.0

    - #### <T> public Stream<T> stream()

      Returns a sequential Stream with the specified element(s) as its source.

           def tokens = new StringTokenizer('one two')
           assert tokens.stream().toList() == ['one', 'two']

      Since:
        3.0.0

    - #### <T> public List<T> toList()

      Convert an enumeration to a List.

      Returns:
        a List
      Since:
        1.5.0

    - #### <T> public Set<T> toSet()

      Convert an enumeration to a Set.

      Returns:
        a Set
      Since:
        1.8.0