io.serialized.client.projection.ProjectionsResponse Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of serialized-client Show documentation
Show all versions of serialized-client Show documentation
Java Client for Serialized APIs
The newest version!
package io.serialized.client.projection;
import java.util.Iterator;
import java.util.List;
import java.util.Spliterator;
import java.util.function.Consumer;
import static java.util.Collections.emptyList;
import static java.util.Collections.unmodifiableList;
public class ProjectionsResponse implements Iterable> {
private List> projections;
private boolean hasMore;
public ProjectionsResponse() {
}
public ProjectionsResponse(List> projections) {
this.projections = projections;
}
public ProjectionsResponse(List> projections, boolean hasMore) {
this.projections = projections;
this.hasMore = hasMore;
}
public List> result() {
return projections == null ? emptyList() : unmodifiableList(projections);
}
public boolean hasMore() {
return hasMore;
}
@Override
public Iterator> iterator() {
return result().iterator();
}
@Override
public void forEach(Consumer super ProjectionResponse> action) {
result().forEach(action);
}
@Override
public Spliterator> spliterator() {
return result().spliterator();
}
}