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

redis.embedded.ports.SequencePortProvider Maven / Gradle / Ivy

Go to download

Redis embedded server for Java integration testing. Project forked from https://github.com/kstyrc/embedded-redis

The newest version!
package redis.embedded.ports;

import redis.embedded.PortProvider;

import java.util.concurrent.atomic.AtomicInteger;

public class SequencePortProvider implements PortProvider {
    private AtomicInteger currentPort = new AtomicInteger(26379);

    public SequencePortProvider() {
    }

    public SequencePortProvider(int currentPort) {
        this.currentPort.set(currentPort);
    }

    public void setCurrentPort(int port) {
        currentPort.set(port);
    }

    @Override
    public int next() {
        return currentPort.getAndIncrement();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy