All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.muserver.openapi.ExternalDocumentationObjectBuilder Maven / Gradle / Ivy

There is a newer version: 2.0.3
Show newest version
package io.muserver.openapi;

import java.net.URI;

/**
 * Allows referencing an external resource for extended documentation.
 */
public class ExternalDocumentationObjectBuilder {
    private String description;
    private URI url;

    /**
     * @param description A short description of the target documentation. CommonMark syntax
     *                    MAY be used for rich text representation.
     * @return The current builder
     */
    public ExternalDocumentationObjectBuilder withDescription(String description) {
        this.description = description;
        return this;
    }

    /**
     * @param url REQUIRED. The URL for the target documentation.
     * @return The current builder
     */
    public ExternalDocumentationObjectBuilder withUrl(URI url) {
        this.url = url;
        return this;
    }

    public ExternalDocumentationObject build() {
        return new ExternalDocumentationObject(description, url);
    }

    /**
     * Creates a builder for an {@link ExternalDocumentationObject}
     *
     * @return A new builder
     */
    public static ExternalDocumentationObjectBuilder externalDocumentationObject() {
        return new ExternalDocumentationObjectBuilder();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy