Eliminate ObjectNode(s) from Operation class
[netconf.git] / restconf / restconf-openapi / src / main / java / org / opendaylight / restconf / openapi / model / MediaTypeObject.java
1 /*
2  * Copyright (c) 2023 PANTHEON.tech, s.r.o. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.restconf.openapi.model;
9
10 import com.fasterxml.jackson.annotation.JsonInclude;
11 import org.eclipse.jdt.annotation.Nullable;
12
13 @JsonInclude(JsonInclude.Include.NON_NULL)
14 public record MediaTypeObject(
15         @Nullable Schema schema) {
16
17     private MediaTypeObject(final Builder builder) {
18         this(builder.schema);
19     }
20
21     @SuppressWarnings("checkstyle:hiddenField")
22     public static class Builder {
23         Schema schema;
24
25         public Builder schema(Schema schema) {
26             this.schema = schema;
27             return this;
28         }
29
30         public MediaTypeObject build() {
31             return new MediaTypeObject(this);
32         }
33     }
34 }