com.maxio.advancedbilling.Environment Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of advanced-billing-sdk Show documentation
Show all versions of advanced-billing-sdk Show documentation
Ultimate billing and pricing flexibility for B2B SaaS.
Maxio integrates directly into your product, so you can seamlessly manage your product catalog, bill customers, and collect payments.
/*
* AdvancedBilling
*
* This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
package com.maxio.advancedbilling;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.TreeMap;
/**
* Environment to be used.
*/
public enum Environment {
/**
* Production server
*/
PRODUCTION,
/**
* Production server
*/
ENVIRONMENT2;
private static TreeMap valueMap = new TreeMap<>();
private String value;
static {
PRODUCTION.value = "production";
ENVIRONMENT2.value = "environment2";
valueMap.put("production", PRODUCTION);
valueMap.put("environment2", ENVIRONMENT2);
}
/**
* Returns the enum member associated with the given string value.
* @param toConvert String value to get enum member.
* @return The enum member against the given string value.
* @throws IOException when provided value is not mapped to any enum member.
*/
@JsonCreator
public static Environment constructFromString(String toConvert) throws IOException {
Environment enumValue = fromString(toConvert);
if (enumValue == null) {
throw new IOException("Unable to create enum instance with value: " + toConvert);
}
return enumValue;
}
/**
* Returns the enum member associated with the given string value.
* @param toConvert String value to get enum member.
* @return The enum member against the given string value.
*/
public static Environment fromString(String toConvert) {
return valueMap.get(toConvert);
}
/**
* Returns the string value associated with the enum member.
* @return The string value against enum member.
*/
@JsonValue
public String value() {
return value;
}
/**
* Get string representation of this enum.
*/
@Override
public String toString() {
return value.toString();
}
/**
* Convert list of Environment values to list of string values.
* @param toConvert The list of Environment values to convert.
* @return List of representative string values.
*/
public static List toValue(List toConvert) {
if (toConvert == null) {
return null;
}
List convertedValues = new ArrayList<>();
for (Environment enumValue : toConvert) {
convertedValues.add(enumValue.value);
}
return convertedValues;
}
}