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

com.eventstore.dbclient.StreamPosition Maven / Gradle / Ivy

package com.eventstore.dbclient;

import java.util.stream.Stream;

public class StreamPosition {
    public static  StreamPosition start() {
        return new Start<>();
    }

    public static  StreamPosition end() {
        return new End<>();
    }

    public static  StreamPosition position(A position) {
        return new Position<>(position);
    }

    public boolean isStart() {
        return this instanceof Start;
    }

    public boolean isEnd() {
        return this instanceof End;
    }

    public final static class Start extends StreamPosition {}
    public final static class End extends StreamPosition {}
    public final static class Position extends StreamPosition {
        private final A position;

        public Position(A position) {
            this.position = position;
        }

        public A getPosition() {
            return position;
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy