io.apicurio.datamodels.models.asyncapi.v20.AsyncApi20DocumentImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of apicurio-data-models Show documentation
Show all versions of apicurio-data-models Show documentation
Open Source API Design Studio
The newest version!
package io.apicurio.datamodels.models.asyncapi.v20;
import com.fasterxml.jackson.databind.JsonNode;
import io.apicurio.datamodels.models.Info;
import io.apicurio.datamodels.models.ModelType;
import io.apicurio.datamodels.models.Node;
import io.apicurio.datamodels.models.RootNodeImpl;
import io.apicurio.datamodels.models.asyncapi.AsyncApiChannels;
import io.apicurio.datamodels.models.asyncapi.AsyncApiComponents;
import io.apicurio.datamodels.models.asyncapi.AsyncApiServers;
import io.apicurio.datamodels.models.asyncapi.v20.visitors.AsyncApi20Visitor;
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 AsyncApi20DocumentImpl extends RootNodeImpl implements AsyncApi20Document {
private String asyncapi;
private String id;
private Info info;
private AsyncApiServers servers;
private String defaultContentType;
private AsyncApiChannels channels;
private AsyncApiComponents components;
private List tags;
private AsyncApi20ExternalDocumentation externalDocs;
private Map extensions;
public AsyncApi20DocumentImpl() {
super(ModelType.ASYNCAPI20);
}
@Override
public String getAsyncapi() {
return asyncapi;
}
@Override
public void setAsyncapi(String value) {
this.asyncapi = value;
}
@Override
public String getId() {
return id;
}
@Override
public void setId(String value) {
this.id = value;
}
@Override
public Info getInfo() {
return info;
}
@Override
public void setInfo(Info value) {
this.info = value;
}
@Override
public AsyncApi20Info createInfo() {
AsyncApi20InfoImpl node = new AsyncApi20InfoImpl();
node.setParent(this);
return node;
}
@Override
public AsyncApiServers getServers() {
return servers;
}
@Override
public void setServers(AsyncApiServers value) {
this.servers = value;
}
@Override
public AsyncApi20Servers createServers() {
AsyncApi20ServersImpl node = new AsyncApi20ServersImpl();
node.setParent(this);
return node;
}
@Override
public String getDefaultContentType() {
return defaultContentType;
}
@Override
public void setDefaultContentType(String value) {
this.defaultContentType = value;
}
@Override
public AsyncApiChannels getChannels() {
return channels;
}
@Override
public void setChannels(AsyncApiChannels value) {
this.channels = value;
}
@Override
public AsyncApi20Channels createChannels() {
AsyncApi20ChannelsImpl node = new AsyncApi20ChannelsImpl();
node.setParent(this);
return node;
}
@Override
public AsyncApiComponents getComponents() {
return components;
}
@Override
public void setComponents(AsyncApiComponents value) {
this.components = value;
}
@Override
public AsyncApi20Components createComponents() {
AsyncApi20ComponentsImpl node = new AsyncApi20ComponentsImpl();
node.setParent(this);
return node;
}
@Override
public AsyncApi20Tag createTag() {
AsyncApi20TagImpl node = new AsyncApi20TagImpl();
node.setParent(this);
return node;
}
@Override
public List getTags() {
return tags;
}
@Override
public void addTag(AsyncApi20Tag value) {
if (this.tags == null) {
this.tags = new ArrayList<>();
}
this.tags.add(value);
}
@Override
public void clearTags() {
if (this.tags != null) {
this.tags.clear();
}
}
@Override
public void removeTag(AsyncApi20Tag value) {
if (this.tags != null) {
this.tags.remove(value);
}
}
@Override
public AsyncApi20ExternalDocumentation getExternalDocs() {
return externalDocs;
}
@Override
public void setExternalDocs(AsyncApi20ExternalDocumentation value) {
this.externalDocs = value;
}
@Override
public AsyncApi20ExternalDocumentation createExternalDocumentation() {
AsyncApi20ExternalDocumentationImpl node = new AsyncApi20ExternalDocumentationImpl();
node.setParent(this);
return node;
}
@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) {
AsyncApi20Visitor viz = (AsyncApi20Visitor) visitor;
viz.visitDocument(this);
}
@Override
public Node emptyClone() {
return new AsyncApi20DocumentImpl();
}
}