io.descoped.rawdata.provider.postgres.PostgresCursor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rawdata-client-provider-postgres Show documentation
Show all versions of rawdata-client-provider-postgres Show documentation
Rawdata Client Provider PostgreSQL Database
The newest version!
package io.descoped.rawdata.provider.postgres;
import de.huxhorn.sulky.ulid.ULID;
import io.descoped.rawdata.api.RawdataCursor;
import java.util.Objects;
public class PostgresCursor implements RawdataCursor {
/**
* Need not exactly match an existing ulid-value.
*/
final ULID.Value startKey;
/**
* Whether or not to include the element with ulid-value matching the lower-bound exactly.
*/
final boolean inclusive;
PostgresCursor(ULID.Value startKey, boolean inclusive) {
this.startKey = startKey;
this.inclusive = inclusive;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
PostgresCursor that = (PostgresCursor) o;
return inclusive == that.inclusive &&
Objects.equals(startKey, that.startKey);
}
@Override
public int hashCode() {
return Objects.hash(startKey, inclusive);
}
@Override
public String toString() {
return "PostgresCursor{" +
"startKey=" + startKey +
", inclusive=" + inclusive +
'}';
}
}