graphql.schema.idl.MapEnumValuesProvider Maven / Gradle / Ivy
package graphql.schema.idl;
import graphql.Assert;
import graphql.PublicApi;
import java.util.Map;
@PublicApi
public class MapEnumValuesProvider implements EnumValuesProvider {
private final Map values;
public MapEnumValuesProvider(Map values) {
Assert.assertNotNull(values, () -> "values can't be null");
this.values = values;
}
@Override
public Object getValue(String name) {
return values.get(name);
}
}