graphql.execution.CoercedVariables Maven / Gradle / Ivy
package graphql.execution;
import graphql.PublicApi;
import graphql.collect.ImmutableKit;
import graphql.collect.ImmutableMapWithNullValues;
import java.util.Map;
/**
* Holds coerced variables, that is their values are now in a canonical form.
*/
@PublicApi
public class CoercedVariables {
private final ImmutableMapWithNullValues coercedVariables;
public CoercedVariables(Map coercedVariables) {
this.coercedVariables = ImmutableMapWithNullValues.copyOf(coercedVariables);
}
public Map toMap() {
return coercedVariables;
}
public boolean containsKey(String key) {
return coercedVariables.containsKey(key);
}
public Object get(String key) {
return coercedVariables.get(key);
}
public static CoercedVariables emptyVariables() {
return new CoercedVariables(ImmutableKit.emptyMap());
}
public static CoercedVariables of(Map coercedVariables) {
return new CoercedVariables(coercedVariables);
}
@Override
public String toString() {
return coercedVariables.toString();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy