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

com.bitpay.sdk.Environment Maven / Gradle / Ivy

Go to download

Full implementation of the BitPay Payment Gateway. This library implements BitPay's Cryptographically Secure RESTful API.

There is a newer version: 10.1.1
Show newest version
/*
 * Copyright (c) 2019 BitPay.
 * All rights reserved.
 */

package com.bitpay.sdk;

import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Objects;

/**
 * The enum Environment.
 */
public enum Environment {

    /**
     * Test environment.
     */
    TEST("Test"),

    /**
     * Prod environment.
     */
    PROD("Prod");

    @JsonValue
    private final String value;

    Environment(String value) {
        this.value = value;
    }

    /**
     * Get Environment from value.
     *
     * @param text the text
     * @return the environment
     */
    public static Environment fromValue(final String text) {
        if (Objects.isNull(text)) {
            return null;
        }

        for (final Environment item : values()) {
            if (String.valueOf(item.value).equalsIgnoreCase(text)) {
                return item;
            }
        }

        return null;
    }

    public String toString() {
        return String.valueOf(this.value);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy