io.ebeaninternal.json.ModifyAwareIterator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ebean Show documentation
Show all versions of ebean Show documentation
composite of common runtime dependencies for all platforms
package io.ebeaninternal.json;
import java.util.Iterator;
/**
* Wraps an iterator for the purposes of detecting modifications.
*/
public class ModifyAwareIterator implements Iterator {
private final ModifyAwareOwner owner;
private final Iterator it;
/**
* Create with an Owner and the underlying Iterator this wraps.
*
* The owner is notified of the removals.
*
*/
public ModifyAwareIterator(ModifyAwareOwner owner, Iterator it) {
this.owner = owner;
this.it = it;
}
@Override
public boolean hasNext() {
return it.hasNext();
}
@Override
public E next() {
return it.next();
}
@Override
public void remove() {
owner.markAsModified();
it.remove();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy