2 * Copyright (c) 2023 PANTHEON.tech, s.r.o. 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.restconf.openapi.model;
10 import static java.util.Objects.requireNonNull;
12 import com.fasterxml.jackson.core.JsonGenerator;
13 import java.io.IOException;
14 import java.util.Deque;
15 import org.eclipse.jdt.annotation.NonNull;
17 public final class PathsEntity extends OpenApiEntity {
18 private final @NonNull Deque<PathEntity> paths;
20 public PathsEntity(final @NonNull Deque<PathEntity> paths) {
21 this.paths = requireNonNull(paths);
25 public void generate(final @NonNull JsonGenerator generator) throws IOException {
26 generator.writeObjectFieldStart("paths");
27 for (final var path : paths) {
28 path.generate(generator);
30 generator.writeEndObject();