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

There is a newer version: 0.3.5
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