com.adyen.model.management.Contact Maven / Gradle / Ivy
/*
* Management API
*
* The version of the OpenAPI document: 3
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.adyen.model.management;
import java.util.Objects;
import java.util.Arrays;
import java.util.Map;
import java.util.HashMap;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.core.JsonProcessingException;
/**
* Contact
*/
@JsonPropertyOrder({
Contact.JSON_PROPERTY_EMAIL,
Contact.JSON_PROPERTY_FIRST_NAME,
Contact.JSON_PROPERTY_INFIX,
Contact.JSON_PROPERTY_LAST_NAME,
Contact.JSON_PROPERTY_PHONE_NUMBER
})
public class Contact {
public static final String JSON_PROPERTY_EMAIL = "email";
private String email;
public static final String JSON_PROPERTY_FIRST_NAME = "firstName";
private String firstName;
public static final String JSON_PROPERTY_INFIX = "infix";
private String infix;
public static final String JSON_PROPERTY_LAST_NAME = "lastName";
private String lastName;
public static final String JSON_PROPERTY_PHONE_NUMBER = "phoneNumber";
private String phoneNumber;
public Contact() {
}
public Contact email(String email) {
this.email = email;
return this;
}
/**
* The individual's email address.
* @return email
**/
@ApiModelProperty(value = "The individual's email address.")
@JsonProperty(JSON_PROPERTY_EMAIL)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getEmail() {
return email;
}
/**
* The individual's email address.
*
* @param email
*/
@JsonProperty(JSON_PROPERTY_EMAIL)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setEmail(String email) {
this.email = email;
}
public Contact firstName(String firstName) {
this.firstName = firstName;
return this;
}
/**
* The individual's first name.
* @return firstName
**/
@ApiModelProperty(value = "The individual's first name.")
@JsonProperty(JSON_PROPERTY_FIRST_NAME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getFirstName() {
return firstName;
}
/**
* The individual's first name.
*
* @param firstName
*/
@JsonProperty(JSON_PROPERTY_FIRST_NAME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public Contact infix(String infix) {
this.infix = infix;
return this;
}
/**
* The infix in the individual's name, if any.
* @return infix
**/
@ApiModelProperty(value = "The infix in the individual's name, if any.")
@JsonProperty(JSON_PROPERTY_INFIX)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getInfix() {
return infix;
}
/**
* The infix in the individual's name, if any.
*
* @param infix
*/
@JsonProperty(JSON_PROPERTY_INFIX)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setInfix(String infix) {
this.infix = infix;
}
public Contact lastName(String lastName) {
this.lastName = lastName;
return this;
}
/**
* The individual's last name.
* @return lastName
**/
@ApiModelProperty(value = "The individual's last name.")
@JsonProperty(JSON_PROPERTY_LAST_NAME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getLastName() {
return lastName;
}
/**
* The individual's last name.
*
* @param lastName
*/
@JsonProperty(JSON_PROPERTY_LAST_NAME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setLastName(String lastName) {
this.lastName = lastName;
}
public Contact phoneNumber(String phoneNumber) {
this.phoneNumber = phoneNumber;
return this;
}
/**
* The individual's phone number, specified as 10-14 digits with an optional `+` prefix.
* @return phoneNumber
**/
@ApiModelProperty(value = "The individual's phone number, specified as 10-14 digits with an optional `+` prefix.")
@JsonProperty(JSON_PROPERTY_PHONE_NUMBER)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getPhoneNumber() {
return phoneNumber;
}
/**
* The individual's phone number, specified as 10-14 digits with an optional `+` prefix.
*
* @param phoneNumber
*/
@JsonProperty(JSON_PROPERTY_PHONE_NUMBER)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setPhoneNumber(String phoneNumber) {
this.phoneNumber = phoneNumber;
}
/**
* Return true if this Contact object is equal to o.
*/
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Contact contact = (Contact) o;
return Objects.equals(this.email, contact.email) &&
Objects.equals(this.firstName, contact.firstName) &&
Objects.equals(this.infix, contact.infix) &&
Objects.equals(this.lastName, contact.lastName) &&
Objects.equals(this.phoneNumber, contact.phoneNumber);
}
@Override
public int hashCode() {
return Objects.hash(email, firstName, infix, lastName, phoneNumber);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Contact {\n");
sb.append(" email: ").append(toIndentedString(email)).append("\n");
sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n");
sb.append(" infix: ").append(toIndentedString(infix)).append("\n");
sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n");
sb.append(" phoneNumber: ").append(toIndentedString(phoneNumber)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
/**
* Create an instance of Contact given an JSON string
*
* @param jsonString JSON string
* @return An instance of Contact
* @throws JsonProcessingException if the JSON string is invalid with respect to Contact
*/
public static Contact fromJson(String jsonString) throws JsonProcessingException {
return JSON.getMapper().readValue(jsonString, Contact.class);
}
/**
* Convert an instance of Contact to an JSON string
*
* @return JSON string
*/
public String toJson() throws JsonProcessingException {
return JSON.getMapper().writeValueAsString(this);
}
}