org.apache.juneau.dto.swagger.Contact 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.*;
/**
* Contact information for the exposed API.
*
* Example:
*
* {
* "name" : "API Support" ,
* "url" : "http://www.swagger.io/support" ,
* "email" : "[email protected]"
* }
*
*
* Additional Information
*
* -
* Juneau Data Transfer Objects
* (org.apache.juneau.dto)
*
* -
* Swagger
*
*
* -
* org.apache.juneau.dto.swagger
*
*
*/
@Bean(properties="name,url,email")
public class Contact extends SwaggerElement {
private String name;
private URI url;
private String email;
/**
* Bean property getter: name .
*
*
* The identifying name of the contact person/organization.
*
* @return The value of the name property on this bean, or null if it is not set.
*/
public String getName() {
return name;
}
/**
* Bean property setter: name .
*
*
* The identifying name of the contact person/organization.
*
* @param name The new value for the name property on this bean.
* @return This object (for method chaining).
*/
public Contact setName(String name) {
this.name = name;
return this;
}
/**
* Synonym for {@link #setName(String)}.
*
* @param name The new value for the name property on this bean.
* @return This object (for method chaining).
*/
public Contact name(String name) {
return setName(name);
}
/**
* Bean property getter: url .
*
*
* The URL pointing to the contact information. MUST be in the format of a URL.
*
* @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 Contact 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 Contact url(Object url) {
return setUrl(url);
}
/**
* Bean property getter: email .
*
*
* The email address of the contact person/organization. MUST be in the format of an email address.
*
* @return The value of the email property on this bean, or null if it is not set.
*/
public String getEmail() {
return email;
}
/**
* Bean property setter: email .
*
*
* The email address of the contact person/organization. MUST be in the format of an email address.
*
* @param email The new value for the email property on this bean.
* @return This object (for method chaining).
*/
public Contact setEmail(String email) {
this.email = email;
return this;
}
/**
* Synonym for {@link #setEmail(String)}.
*
* @param email The new value for the email property on this bean.
* @return This object (for method chaining).
*/
public Contact email(String email) {
return setEmail(email);
}
}