org.apache.hc.core5.http.message

## Class BasicHeaderIterator

- java.lang.Object
- - org.apache.hc.core5.http.message.BasicHeaderIterator

- All Implemented Interfaces:
    Iterator<Header>

      public class BasicHeaderIterator
      extends Object
      implements Iterator<Header>

  `Iterator` of `Header`s.
  Since:
    4.0

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BasicHeaderIterator(Header[] headers, String name)` Creates a new header iterator.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `hasNext()`
    `Header` | `next()` Obtains the next header from this iteration.
    `void` | `remove()` Removing headers is not supported.

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

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

- - ### Constructor Detail

    - #### BasicHeaderIterator

          public BasicHeaderIterator(Header[] headers,
                             String name)

      Creates a new header iterator.
      Parameters:
        `headers` - an array of headers over which to iterate
        `name` - the name of the headers over which to iterate, or `null` for any

  - ### Method Detail

    - #### hasNext

          public boolean hasNext()

      Specified by:
        `hasNext` in interface `Iterator<Header>`

    - #### next

          public Header next()
                      throws NoSuchElementException

      Obtains the next header from this iteration.
      Specified by:
        `next` in interface `Iterator<Header>`
      Returns:
        the next header in this iteration
      Throws:
        `NoSuchElementException` - if there are no more headers

    - #### remove

          public void remove()
                      throws UnsupportedOperationException

      Removing headers is not supported.
      Specified by:
        `remove` in interface `Iterator<Header>`
      Throws:
        `UnsupportedOperationException` - always

Copyright © 2005–2020 The Apache Software Foundation. All rights reserved.