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

io.polyglotted.pgmodel.search.DocStatus Maven / Gradle / Ivy

Go to download

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

The newest version!
package io.polyglotted.pgmodel.search;

import com.google.common.collect.ImmutableMap;

import java.util.Map;

public enum DocStatus {
    LIVE, EXPIRED, DELETED, PENDING, PENDING_DELETE, REJECTED, DISCARDED;

    private static final Map STATUS_MAP = buildStatusMap();

    public static DocStatus fromStatus(String status) {
        return STATUS_MAP.get(status);
    }

    private static Map buildStatusMap() {
        ImmutableMap.Builder builder = ImmutableMap.builder();
        for (DocStatus status : values()) {
            builder.put(status.name(), status);
            builder.put(status.name().toLowerCase(), status);
        }
        return builder.build();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy