io.sphere.sdk.queries.QueryEndpointElementsPublisher Maven / Gradle / Ivy
The newest version!
package io.sphere.sdk.queries;
import io.sphere.sdk.client.SphereClient;
import io.sphere.sdk.models.Base;
import org.reactivestreams.Publisher;
import org.reactivestreams.Subscriber;
import java.util.function.Function;
import static java.util.Objects.requireNonNull;
final class QueryEndpointElementsPublisher> extends Base implements Publisher {
private final QueryDsl seedQuery;
private final Function idExtractor;
private final SphereClient sphereClient;
QueryEndpointElementsPublisher(final QueryDsl seedQuery, final Function idExtractor, final SphereClient sphereClient) {
this.seedQuery = seedQuery;
this.idExtractor = idExtractor;
this.sphereClient = sphereClient;
}
@Override
public void subscribe(final Subscriber super T> subscriber) {
requireNonNull(subscriber);
subscriber.onSubscribe(new SubscriptionImpl<>(seedQuery, idExtractor, sphereClient, subscriber));
}
}