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

org.vfdtech.enums.RedisEnvironment Maven / Gradle / Ivy

Go to download

A utilities service with generic tools implementation. Can be plugged into your java project. This is designed for Java 1.8

There is a newer version: 1.0.0
Show newest version
package org.vfdtech.enums;

import lombok.Getter;

import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;

@Getter
public enum RedisEnvironment {
    DEVELOPMENT(3),  PRODUCTION(4), STAGING(5);

    final int dbIndex;

    RedisEnvironment(final int dbIndex) {
        this.dbIndex = dbIndex;
    }

    public static Optional getInstance(final String va) {
        final List correspondingRedisEnv =
                Arrays.stream(values()).filter(redisEnvironment ->
                        redisEnvironment.name().equalsIgnoreCase(va)).collect(Collectors.toList());

        return correspondingRedisEnv.stream().findFirst();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy