Uploaded image for project: 'Commons Collections'
  1. Commons Collections
  2. COLLECTIONS-671

Add org.apache.commons.collections4.IterableUtils.first(Iterable<E>)

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 4.2
    • Iterator
    • None

    Description

      Add org.apache.commons.collections4.IterableUtils.first(Iterable<E>):

          /**
           * Returns the <code>first</code> value in the <code>iterable</code>'s {@link Iterator}, throwing
           * <code>IndexOutOfBoundsException</code> if there is no such element.
           * <p>
           * If the {@link Iterable} is a {@link List}, then it will use {@link List#get(int)}.
           *
           * @param <T> the type of object in the {@link Iterable}.
           * @param iterable  the {@link Iterable} to get a value from, may be null
           * @return the first object
           * @throws IndexOutOfBoundsException if the request  is invalid
           * @since 4.2
           */
          public static <T> T first(final Iterable<T> iterable)
      

      Attachments

        Activity

          People

            ggregory Gary D. Gregory
            ggregory Gary D. Gregory
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: