org.apache.juneau.dto.swagger.ExternalDocumentation Maven / Gradle / Ivy
// ***************************************************************************************************************************
// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
// * with the License. You may obtain a copy of the License at *
// * *
// * http://www.apache.org/licenses/LICENSE-2.0 *
// * *
// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *
// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
// * specific language governing permissions and limitations under the License. *
// ***************************************************************************************************************************
package org.apache.juneau.dto.swagger;
import static org.apache.juneau.internal.StringUtils.*;
import java.net.*;
import java.net.URI;
import org.apache.juneau.*;
import org.apache.juneau.annotation.*;
/**
* Allows referencing an external resource for extended documentation.
*
* Example:
*
* {
* "description" : "Find more info here" ,
* "url" : "https://swagger.io"
* }
*
*
* Additional Information
*
* -
* Juneau Data Transfer Objects
* (org.apache.juneau.dto)
*
* -
* Swagger
*
*
* -
* org.apache.juneau.dto.swagger
*
*
*/
@Bean(properties="description,url")
public class ExternalDocumentation extends SwaggerElement {
private String description;
private URI url;
/**
* Bean property getter: description .
*
*
* A short description of the target documentation. GFM syntax can be used for rich text representation.
*
* @return
* The value of the description property on this bean, or null if it is not set.
*/
public String getDescription() {
return description;
}
/**
* Bean property setter: description .
*
*
* A short description of the target documentation. GFM syntax can be used for rich text representation.
*
* @param description The new value for the description property on this bean.
* @return This object (for method chaining).
*/
public ExternalDocumentation setDescription(String description) {
this.description = description;
return this;
}
/**
* Synonym for {@link #setDescription(String)}.
*
* @param description The new value for the description property on this bean.
* @return This object (for method chaining).
*/
public ExternalDocumentation description(String description) {
return setDescription(description);
}
/**
* Bean property getter: url .
*
*
* Required. The URL for the target documentation.
*
*
* The value can be of any of the following types: {@link URI}, {@link URL}, {@link String}.
* Strings must be valid URIs.
*
*
* URIs defined by {@link UriResolver} can be used for values.
*
* @return The value of the url property on this bean, or null if it is not set.
*/
public URI getUrl() {
return url;
}
/**
* Bean property setter: url .
*
*
* The value can be of any of the following types: {@link URI}, {@link URL}, {@link String}.
* Strings must be valid URIs.
*
*
* URIs defined by {@link UriResolver} can be used for values.
*
* @param url The new value for the url property on this bean.
* @return This object (for method chaining).
*/
public ExternalDocumentation setUrl(Object url) {
this.url = toURI(url);
return this;
}
/**
* Synonym for {@link #setUrl(Object)}.
*
* @param url The new value for the url property on this bean.
* @return This object (for method chaining).
*/
public ExternalDocumentation url(Object url) {
return setUrl(url);
}
}