All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.smallrye.mutiny.groups.MultiIfNoItem Maven / Gradle / Ivy

package io.smallrye.mutiny.groups;

import static io.smallrye.mutiny.helpers.ParameterValidation.nonNull;
import static io.smallrye.mutiny.helpers.ParameterValidation.validate;

import java.time.Duration;

import io.smallrye.mutiny.shaded.io.smallrye.common.annotation.CheckReturnValue;
import io.smallrye.mutiny.Multi;

public class MultiIfNoItem {

    private final Multi upstream;

    public MultiIfNoItem(Multi upstream) {
        this.upstream = nonNull(upstream, "upstream");
    }

    /**
     * Configures the timeout duration.
     *
     * @param timeout the timeout, must not be {@code null}, must be strictly positive.
     * @return a new {@link MultiOnItemTimeout}
     */
    @CheckReturnValue
    public MultiOnItemTimeout after(Duration timeout) {
        return new MultiOnItemTimeout<>(upstream, validate(timeout, "timeout"), null);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy