2 * Copyright (c) 2018 Inocybe Technologies and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.netconf.sal.rest.doc.impl;
10 import java.util.Optional;
11 import org.opendaylight.mdsal.dom.api.DOMSchemaService;
14 * Base class for a bierman draft02 implementation.
16 * @author Thomas Pantelis
18 public abstract class BaseYangSwaggerGeneratorDraft02 extends BaseYangSwaggerGenerator {
20 protected static final String DEFAULT_BASE_PATH = "restconf";
21 private final String basePath;
23 protected BaseYangSwaggerGeneratorDraft02(final Optional<DOMSchemaService> schemaService) {
25 this.basePath = DEFAULT_BASE_PATH;
28 protected BaseYangSwaggerGeneratorDraft02(final Optional<DOMSchemaService> schemaService, final String basePath) {
30 this.basePath = basePath;
34 public String getDataStorePath(final String dataStore, final String context) {
35 return "/" + basePath + "/" + dataStore + context;
39 public String getContent(final String dataStore) {
44 protected ListPathBuilder newListPathBuilder() {
45 return key -> "/{" + key + "}";
49 protected void appendPathKeyValue(StringBuilder builder, Object value) {
50 builder.append(value).append('/');