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

graphql.annotations.processor.ProcessingElementsContainer Maven / Gradle / Ivy

/**
 * Copyright 2016 Yurii Rashkovskii
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 */
package graphql.annotations.processor;


import graphql.annotations.processor.graphQLProcessors.GraphQLInputProcessor;
import graphql.annotations.processor.graphQLProcessors.GraphQLOutputProcessor;
import graphql.annotations.processor.typeFunctions.DefaultTypeFunction;
import graphql.annotations.processor.typeFunctions.TypeFunction;
import graphql.relay.Relay;
import graphql.schema.GraphQLCodeRegistry;
import graphql.schema.GraphQLDirective;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.Stack;

import static graphql.annotations.processor.util.InputPropertiesUtil.DEFAULT_INPUT_PREFIX;
import static graphql.annotations.processor.util.InputPropertiesUtil.DEFAULT_INPUT_SUFFIX;
import static graphql.schema.GraphQLCodeRegistry.newCodeRegistry;

public class ProcessingElementsContainer {

    private TypeFunction defaultTypeFunction;
    private graphql.relay.Relay relay;
    private Map typeRegistry;
    private Map directiveRegistry;
    private Map, Set>> extensionsTypeRegistry;
    private GraphQLCodeRegistry.Builder codeRegistryBuilder;
    private Stack processing;
    private String inputPrefix = DEFAULT_INPUT_PREFIX;
    private String inputSuffix = DEFAULT_INPUT_SUFFIX;

    public Map getDirectiveRegistry() {
        return directiveRegistry;
    }

    public void setDirectiveRegistry(Map directiveRegistry) {
        this.directiveRegistry = directiveRegistry;
    }

    public ProcessingElementsContainer(TypeFunction defaultTypeFunction, Relay relay, Map typeRegistry, Map directiveRegistry,
                                       Map, Set>> extensionsTypeRegistry, Stack processing,
                                       GraphQLCodeRegistry.Builder codeRegistryBuilder) {
        this.defaultTypeFunction = defaultTypeFunction;
        this.relay = relay;
        this.typeRegistry = typeRegistry;
        this.directiveRegistry = directiveRegistry;
        this.extensionsTypeRegistry = extensionsTypeRegistry;
        this.processing = processing;
        this.codeRegistryBuilder = codeRegistryBuilder;
    }

    public ProcessingElementsContainer(TypeFunction typeFunction) {
        this(typeFunction, new Relay(), new HashMap<>(), new HashMap<>(), new HashMap<>(), new Stack<>(), newCodeRegistry());
    }

    public ProcessingElementsContainer() {
        this(new DefaultTypeFunction(new GraphQLInputProcessor(), new GraphQLOutputProcessor()), new Relay(), new HashMap<>(), new HashMap<>(), new HashMap<>(), new Stack<>(), newCodeRegistry());
    }

    public Relay getRelay() {
        return this.relay;
    }

    public void setRelay(Relay relay) {
        this.relay = relay;
    }

    public Map getTypeRegistry() {
        return this.typeRegistry;
    }

    public void setTypeRegistry(Map typeRegistry) {
        this.typeRegistry = typeRegistry;
    }

    public Map, Set>> getExtensionsTypeRegistry() {
        return this.extensionsTypeRegistry;
    }

    public void setExtensionsTypeRegistry(Map, Set>> extensionsTypeRegistry) {
        this.extensionsTypeRegistry = extensionsTypeRegistry;
    }

    public TypeFunction getDefaultTypeFunction() {
        return defaultTypeFunction;
    }

    public void setDefaultTypeFunction(TypeFunction defaultTypeFunction) {
        this.defaultTypeFunction = defaultTypeFunction;
    }

    public Stack getProcessing() {
        return processing;
    }

    public void setProcessing(Stack processing) {
        this.processing = processing;
    }

    public String getInputPrefix() {
        return inputPrefix;
    }

    public void setInputPrefix(String inputPrefix) {
        this.inputPrefix = inputPrefix;
    }

    public String getInputSuffix() {
        return inputSuffix;
    }

    public void setInputSuffix(String inputSuffix) {
        this.inputSuffix = inputSuffix;
    }

    public void setCodeRegistryBuilder(GraphQLCodeRegistry.Builder builder) {
        this.codeRegistryBuilder = builder;
    }

    public GraphQLCodeRegistry.Builder getCodeRegistryBuilder() {
        return this.codeRegistryBuilder;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy