/** Generated by the default template from graphql-java-generator */
package com.graphql_java_generator.domain.client.allGraphQLCases;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.graphql_java_generator.annotation.GraphQLEnumType;

/**
 * ############################
 *  test for issue #139:
 * <BR/>
 * 
 * @author generated by graphql-java-generator
 * @see <a href="https://github.com/graphql-java-generator/graphql-java-generator">https://github.com/graphql-java-generator/graphql-java-generator</a>
 */
@GraphQLEnumType("EnumWithReservedJavaKeywordAsValues")
@SuppressWarnings("unused")
public enum EnumWithReservedJavaKeywordAsValues {
	@JsonProperty("abstract") // Needed as abstract is a java reserved keyword
	_abstract("abstract"), 
	@JsonProperty("assert") // Needed as assert is a java reserved keyword
	_assert("assert"), 
	@JsonProperty("boolean") // Needed as boolean is a java reserved keyword
	_boolean("boolean"), 
	@JsonProperty("break") // Needed as break is a java reserved keyword
	_break("break"), 
	@JsonProperty("byte") // Needed as byte is a java reserved keyword
	_byte("byte"), 
	@JsonProperty("case") // Needed as case is a java reserved keyword
	_case("case"), 
	@JsonProperty("catch") // Needed as catch is a java reserved keyword
	_catch("catch"), 
	@JsonProperty("char") // Needed as char is a java reserved keyword
	_char("char"), 
	@JsonProperty("class") // Needed as class is a java reserved keyword
	_class("class"), 
	@JsonProperty("const") // Needed as const is a java reserved keyword
	_const("const"), 
	@JsonProperty("continue") // Needed as continue is a java reserved keyword
	_continue("continue"), 
	@JsonProperty("default") // Needed as default is a java reserved keyword
	_default("default"), 
	@JsonProperty("do") // Needed as do is a java reserved keyword
	_do("do"), 
	@JsonProperty("double") // Needed as double is a java reserved keyword
	_double("double"), 
	@JsonProperty("else") // Needed as else is a java reserved keyword
	_else("else"), 
	@JsonProperty("enum") // Needed as enum is a java reserved keyword
	_enum("enum"), 
	@JsonProperty("extends") // Needed as extends is a java reserved keyword
	_extends("extends"), 
	@JsonProperty("final") // Needed as final is a java reserved keyword
	_final("final"), 
	@JsonProperty("finally") // Needed as finally is a java reserved keyword
	_finally("finally"), 
	@JsonProperty("float") // Needed as float is a java reserved keyword
	_float("float"), 
	@JsonProperty("for") // Needed as for is a java reserved keyword
	_for("for"), 
	@JsonProperty("goto") // Needed as goto is a java reserved keyword
	_goto("goto"), 
	@JsonProperty("if") // Needed as if is a java reserved keyword
	_if("if"), 
	@JsonProperty("implements") // Needed as implements is a java reserved keyword
	_implements("implements"), 
	@JsonProperty("import") // Needed as import is a java reserved keyword
	_import("import"), 
	@JsonProperty("instanceof") // Needed as instanceof is a java reserved keyword
	_instanceof("instanceof"), 
	@JsonProperty("int") // Needed as int is a java reserved keyword
	_int("int"), 
	@JsonProperty("interface") // Needed as interface is a java reserved keyword
	_interface("interface"), 
	@JsonProperty("long") // Needed as long is a java reserved keyword
	_long("long"), 
	@JsonProperty("native") // Needed as native is a java reserved keyword
	_native("native"), 
	@JsonProperty("new") // Needed as new is a java reserved keyword
	_new("new"), 
	@JsonProperty("package") // Needed as package is a java reserved keyword
	_package("package"), 
	@JsonProperty("private") // Needed as private is a java reserved keyword
	_private("private"), 
	@JsonProperty("protected") // Needed as protected is a java reserved keyword
	_protected("protected"), 
	@JsonProperty("public") // Needed as public is a java reserved keyword
	_public("public"), 
	@JsonProperty("return") // Needed as return is a java reserved keyword
	_return("return"), 
	@JsonProperty("short") // Needed as short is a java reserved keyword
	_short("short"), 
	@JsonProperty("static") // Needed as static is a java reserved keyword
	_static("static"), 
	@JsonProperty("strictfp") // Needed as strictfp is a java reserved keyword
	_strictfp("strictfp"), 
	@JsonProperty("super") // Needed as super is a java reserved keyword
	_super("super"), 
	@JsonProperty("switch") // Needed as switch is a java reserved keyword
	_switch("switch"), 
	@JsonProperty("synchronized") // Needed as synchronized is a java reserved keyword
	_synchronized("synchronized"), 
	@JsonProperty("this") // Needed as this is a java reserved keyword
	_this("this"), 
	@JsonProperty("throw") // Needed as throw is a java reserved keyword
	_throw("throw"), 
	@JsonProperty("throws") // Needed as throws is a java reserved keyword
	_throws("throws"), 
	@JsonProperty("transient") // Needed as transient is a java reserved keyword
	_transient("transient"), 
	@JsonProperty("try") // Needed as try is a java reserved keyword
	_try("try"), 
	@JsonProperty("void") // Needed as void is a java reserved keyword
	_void("void"), 
	@JsonProperty("volatile") // Needed as volatile is a java reserved keyword
	_volatile("volatile"), 
	@JsonProperty("while") // Needed as while is a java reserved keyword
	_while("while");

	// The graphQlValue is needed on server side, to map the enum value to the value defined in the GraphQL schema. They are different
	// when the value in the GraphQL schema is a java reserved keyword.
	private final String graphQlValue;

	/**
	 * Returns the value of this constant, as specified in the GraphQL schema. This is usually the same as the enum
	 * item's name. But it will differ if this name is a java reserved keyword (in which case the name is prefixed by an
	 * underscore)
	 * 
	 * @return the enum constant with the specified name, as defined in the GraphQL schema
	 */
	public String graphQlValue() {
		return graphQlValue;
	}
	
	/**
	 * Returns the enum constant of this type with the specified name (as specified in the GraphQL schema). The string
	 * must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters
	 * are not permitted.)
	 * 
	 * @param graphQlValue
	 *            The value, as defined in the GraphQL schema. This is usually the same as the enum item's name. But it
	 *            will differ if this name is a java reserved keyword (in which case the name is prefixed by an
	 *            underscore)
	 * @return the enum constant with the specified name
	 * @throws IllegalArgumentException
	 *             if this enum type has no constant with the specified GraphQL name
	 */
	static public EnumWithReservedJavaKeywordAsValues fromGraphQlValue(String graphQlValue) {
		if (graphQlValue == null) {
			return null;
		}
		for (EnumWithReservedJavaKeywordAsValues e : EnumWithReservedJavaKeywordAsValues.values()) {
			if (e.graphQlValue().equals(graphQlValue)) {
				return e;
			}
		}
		throw new IllegalArgumentException("No EnumWithReservedJavaKeywordAsValues exists with '" + graphQlValue + "' as a GraphQL value");
	}

	EnumWithReservedJavaKeywordAsValues(String graphQlValue) {
		this.graphQlValue = graphQlValue;
	}
}
