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

io.apicurio.datamodels.models.openapi.v31.OpenApi31OperationImpl Maven / Gradle / Ivy

The newest version!
package io.apicurio.datamodels.models.openapi.v31;

import com.fasterxml.jackson.databind.JsonNode;
import io.apicurio.datamodels.models.ExternalDocumentation;
import io.apicurio.datamodels.models.Node;
import io.apicurio.datamodels.models.NodeImpl;
import io.apicurio.datamodels.models.openapi.OpenApiParameter;
import io.apicurio.datamodels.models.openapi.OpenApiResponses;
import io.apicurio.datamodels.models.openapi.OpenApiSecurityRequirement;
import io.apicurio.datamodels.models.openapi.v31.visitors.OpenApi31Visitor;
import io.apicurio.datamodels.models.visitors.Visitor;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

public class OpenApi31OperationImpl extends NodeImpl implements OpenApi31Operation {

	private List tags;
	private String summary;
	private String description;
	private ExternalDocumentation externalDocs;
	private String operationId;
	private List parameters;
	private OpenApi31RequestBody requestBody;
	private OpenApiResponses responses;
	private Map callbacks;
	private Boolean deprecated;
	private List security;
	private List servers;
	private Map extensions;

	@Override
	public List getTags() {
		return tags;
	}

	@Override
	public void setTags(List value) {
		this.tags = value;
	}

	@Override
	public String getSummary() {
		return summary;
	}

	@Override
	public void setSummary(String value) {
		this.summary = value;
	}

	@Override
	public String getDescription() {
		return description;
	}

	@Override
	public void setDescription(String value) {
		this.description = value;
	}

	@Override
	public ExternalDocumentation getExternalDocs() {
		return externalDocs;
	}

	@Override
	public void setExternalDocs(ExternalDocumentation value) {
		this.externalDocs = value;
	}

	@Override
	public OpenApi31ExternalDocumentation createExternalDocumentation() {
		OpenApi31ExternalDocumentationImpl node = new OpenApi31ExternalDocumentationImpl();
		node.setParent(this);
		return node;
	}

	@Override
	public String getOperationId() {
		return operationId;
	}

	@Override
	public void setOperationId(String value) {
		this.operationId = value;
	}

	@Override
	public OpenApi31Parameter createParameter() {
		OpenApi31ParameterImpl node = new OpenApi31ParameterImpl();
		node.setParent(this);
		return node;
	}

	@Override
	public List getParameters() {
		return parameters;
	}

	@Override
	public void addParameter(OpenApiParameter value) {
		if (this.parameters == null) {
			this.parameters = new ArrayList<>();
		}
		this.parameters.add(value);
	}

	@Override
	public void clearParameters() {
		if (this.parameters != null) {
			this.parameters.clear();
		}
	}

	@Override
	public void removeParameter(OpenApiParameter value) {
		if (this.parameters != null) {
			this.parameters.remove(value);
		}
	}

	@Override
	public OpenApi31RequestBody getRequestBody() {
		return requestBody;
	}

	@Override
	public void setRequestBody(OpenApi31RequestBody value) {
		this.requestBody = value;
	}

	@Override
	public OpenApi31RequestBody createRequestBody() {
		OpenApi31RequestBodyImpl node = new OpenApi31RequestBodyImpl();
		node.setParent(this);
		return node;
	}

	@Override
	public OpenApiResponses getResponses() {
		return responses;
	}

	@Override
	public void setResponses(OpenApiResponses value) {
		this.responses = value;
	}

	@Override
	public OpenApi31Responses createResponses() {
		OpenApi31ResponsesImpl node = new OpenApi31ResponsesImpl();
		node.setParent(this);
		return node;
	}

	@Override
	public OpenApi31Callback createCallback() {
		OpenApi31CallbackImpl node = new OpenApi31CallbackImpl();
		node.setParent(this);
		return node;
	}

	@Override
	public Map getCallbacks() {
		return callbacks;
	}

	@Override
	public void addCallback(String name, OpenApi31Callback value) {
		if (this.callbacks == null) {
			this.callbacks = new LinkedHashMap<>();
		}
		this.callbacks.put(name, value);
	}

	@Override
	public void clearCallbacks() {
		if (this.callbacks != null) {
			this.callbacks.clear();
		}
	}

	@Override
	public void removeCallback(String name) {
		if (this.callbacks != null) {
			this.callbacks.remove(name);
		}
	}

	@Override
	public Boolean isDeprecated() {
		return deprecated;
	}

	@Override
	public void setDeprecated(Boolean value) {
		this.deprecated = value;
	}

	@Override
	public OpenApi31SecurityRequirement createSecurityRequirement() {
		OpenApi31SecurityRequirementImpl node = new OpenApi31SecurityRequirementImpl();
		node.setParent(this);
		return node;
	}

	@Override
	public List getSecurity() {
		return security;
	}

	@Override
	public void addSecurity(OpenApiSecurityRequirement value) {
		if (this.security == null) {
			this.security = new ArrayList<>();
		}
		this.security.add(value);
	}

	@Override
	public void clearSecurity() {
		if (this.security != null) {
			this.security.clear();
		}
	}

	@Override
	public void removeSecurity(OpenApiSecurityRequirement value) {
		if (this.security != null) {
			this.security.remove(value);
		}
	}

	@Override
	public OpenApi31Server createServer() {
		OpenApi31ServerImpl node = new OpenApi31ServerImpl();
		node.setParent(this);
		return node;
	}

	@Override
	public List getServers() {
		return servers;
	}

	@Override
	public void addServer(OpenApi31Server value) {
		if (this.servers == null) {
			this.servers = new ArrayList<>();
		}
		this.servers.add(value);
	}

	@Override
	public void clearServers() {
		if (this.servers != null) {
			this.servers.clear();
		}
	}

	@Override
	public void removeServer(OpenApi31Server value) {
		if (this.servers != null) {
			this.servers.remove(value);
		}
	}

	@Override
	public Map getExtensions() {
		return extensions;
	}

	@Override
	public void addExtension(String name, JsonNode value) {
		if (this.extensions == null) {
			this.extensions = new LinkedHashMap<>();
		}
		this.extensions.put(name, value);
	}

	@Override
	public void clearExtensions() {
		if (this.extensions != null) {
			this.extensions.clear();
		}
	}

	@Override
	public void removeExtension(String name) {
		if (this.extensions != null) {
			this.extensions.remove(name);
		}
	}

	@Override
	public void accept(Visitor visitor) {
		OpenApi31Visitor viz = (OpenApi31Visitor) visitor;
		viz.visitOperation(this);
	}

	@Override
	public Node emptyClone() {
		return new OpenApi31OperationImpl();
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy