io.apicurio.datamodels.models.openapi.v31.OpenApi31PathsImpl 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.openapi.v31;
import com.fasterxml.jackson.databind.JsonNode;
import io.apicurio.datamodels.models.Node;
import io.apicurio.datamodels.models.NodeImpl;
import io.apicurio.datamodels.models.openapi.OpenApiPathItem;
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 OpenApi31PathsImpl extends NodeImpl implements OpenApi31Paths {
private Map extensions;
private Map _items = new LinkedHashMap<>();
@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 OpenApiPathItem getItem(String name) {
return this._items.get(name);
}
@Override
public List getItems() {
List rval = new ArrayList<>();
rval.addAll(this._items.values());
return rval;
}
@Override
public List getItemNames() {
List rval = new ArrayList<>();
rval.addAll(this._items.keySet());
return rval;
}
@Override
public void addItem(String name, OpenApiPathItem item) {
this._items.put(name, item);
}
@Override
public OpenApiPathItem removeItem(String name) {
return this._items.remove(name);
}
@Override
public OpenApi31PathItem createPathItem() {
OpenApi31PathItemImpl node = new OpenApi31PathItemImpl();
node.setParent(this);
return node;
}
@Override
public void accept(Visitor visitor) {
OpenApi31Visitor viz = (OpenApi31Visitor) visitor;
viz.visitPaths(this);
}
@Override
public Node emptyClone() {
return new OpenApi31PathsImpl();
}
}