/** * Return an <strong>immutable</strong> {@link Iterator Iterator<Object>} around * the content of this {@code Tuple}. * * @implNote As an {@link Iterator} is always tied to its {@link Iterable} source by * definition, the iterator cannot be mutable without the iterable also being mutable. * Since {@link Tuples} are <strong>immutable</strong>, so is the {@link Iterator} * returned by this method. * * @return An unmodifiable {@link Iterator} over the elements in this Tuple. */ @Override public Iterator<Object> iterator() { return Collections.unmodifiableList(toList()).iterator(); }
/** * Return an <strong>immutable</strong> {@link Iterator Iterator<Object>} around * the content of this {@code Tuple}. * * @implNote As an {@link Iterator} is always tied to its {@link Iterable} source by * definition, the iterator cannot be mutable without the iterable also being mutable. * Since {@link Tuples} are <strong>immutable</strong>, so is the {@link Iterator} * returned by this method. * * @return An unmodifiable {@link Iterator} over the elements in this Tuple. */ @Override public Iterator<Object> iterator() { return Collections.unmodifiableList(toList()).iterator(); }