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

io.quarkus.redis.datasource.stream.StreamRange Maven / Gradle / Ivy

There is a newer version: 3.17.5
Show newest version
package io.quarkus.redis.datasource.stream;

import java.util.ArrayList;
import java.util.List;

import io.quarkus.redis.datasource.RedisCommandExtraArguments;
import io.quarkus.redis.runtime.datasource.Validation;

/**
 * Represents a stream range.
 */
public class StreamRange implements RedisCommandExtraArguments {

    private final String lowerBound;

    private final String higherBound;

    public StreamRange(String lowerBound, String higherBound) {
        this.lowerBound = Validation.notNullOrBlank(lowerBound, "lowerBound");
        this.higherBound = Validation.notNullOrBlank(higherBound, "higherBound");
    }

    public static StreamRange of(String lowerBound, String higherBound) {
        return new StreamRange(lowerBound, higherBound);
    }

    @Override
    public List toArgs() {
        List list = new ArrayList<>();
        list.add(lowerBound);
        list.add(higherBound);
        return list;
    }
}