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

io.polyglotted.pgmodel.search.query.StandardScroll Maven / Gradle / Ivy

Go to download

Standard set of models for geo coding, access control and elastic search abstraction

There is a newer version: 1.4.1
Show newest version
package io.polyglotted.pgmodel.search.query;

import lombok.RequiredArgsConstructor;
import lombok.ToString;

import java.util.Objects;

import static io.polyglotted.pgmodel.util.ModelUtil.jsonEquals;
import static java.util.concurrent.TimeUnit.MINUTES;

@RequiredArgsConstructor
@ToString(includeFieldNames = false, doNotUseGetters = true)
public final class StandardScroll {
    public final String scrollId;
    public final long scrollTimeInMillis;

    @Override
    public boolean equals(Object o) {
        return jsonEquals(this, o);
    }

    @Override
    public int hashCode() {
        return Objects.hash(scrollId, scrollTimeInMillis);
    }

    public static StandardScroll fromScrollId(String scrollId) {
        return new StandardScroll(scrollId, MINUTES.toMillis(5));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy