Package net.dona.doip

# Class InDoipMessageFromCollection

java.lang.Object
net.dona.doip.InDoipMessageFromCollection

All Implemented Interfaces:
  `AutoCloseable`, `Iterable<InDoipSegment>`, `InDoipMessage`

public class InDoipMessageFromCollection extends Object implements InDoipMessage
An implementation of `InDoipMessage` constructed by supplying an explicit collection of `InDoipSegment` objects.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `InDoipMessageFromCollection(Collection<InDoipSegment> segments)`
  Constructs an `InDoipMessage` object whose segments are those in the supplied collection.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `close()`
  A no-op for this implementation.
  `Iterator<InDoipSegment>`
  `iterator()`
  `Spliterator<InDoipSegment>`
  `spliterator()`
  `Stream<InDoipSegment>`
  `stream()`
  Returns an stream over elements of type `InDoipSegment`.

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

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

  ### Methods inherited from interface java.lang.Iterable

  `forEach`

- ## Constructor Details

  - ### InDoipMessageFromCollection

    public InDoipMessageFromCollection(Collection<InDoipSegment> segments)
    Constructs an `InDoipMessage` object whose segments are those in the supplied collection.
    Parameters:
      `segments` - the segments of the message

- ## Method Details

  - ### iterator

    public Iterator<InDoipSegment> iterator()
    Specified by:
      `iterator` in interface `Iterable<InDoipSegment>`

  - ### spliterator

    public Spliterator<InDoipSegment> spliterator()
    Specified by:
      `spliterator` in interface `Iterable<InDoipSegment>`

  - ### stream

    public Stream<InDoipSegment> stream()
    Description copied from interface: `InDoipMessage`
    Returns an stream over elements of type `InDoipSegment`.
    Specified by:
      `stream` in interface `InDoipMessage`
    Returns:
      a Stream.

  - ### close

    public void close()
    A no-op for this implementation.
    Specified by:
      `close` in interface `AutoCloseable`
    Specified by:
      `close` in interface `InDoipMessage`