
com.adyen.model.legalentitymanagement.Address Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of adyen-java-api-library Show documentation
Show all versions of adyen-java-api-library Show documentation
Adyen API Client Library for Java
/*
* Legal Entity 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.legalentitymanagement;
import java.util.Objects;
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 java.util.Arrays;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.core.JsonProcessingException;
/**
* Address
*/
@JsonPropertyOrder({
Address.JSON_PROPERTY_CITY,
Address.JSON_PROPERTY_COUNTRY,
Address.JSON_PROPERTY_POSTAL_CODE,
Address.JSON_PROPERTY_STATE_OR_PROVINCE,
Address.JSON_PROPERTY_STREET,
Address.JSON_PROPERTY_STREET2
})
public class Address {
public static final String JSON_PROPERTY_CITY = "city";
private String city;
public static final String JSON_PROPERTY_COUNTRY = "country";
private String country;
public static final String JSON_PROPERTY_POSTAL_CODE = "postalCode";
private String postalCode;
public static final String JSON_PROPERTY_STATE_OR_PROVINCE = "stateOrProvince";
private String stateOrProvince;
public static final String JSON_PROPERTY_STREET = "street";
private String street;
public static final String JSON_PROPERTY_STREET2 = "street2";
private String street2;
public Address() {
}
/**
* The name of the city. Required if `stateOrProvince` is provided. If you specify the city, you must also send `postalCode` and `street`.
*
* @param city The name of the city. Required if `stateOrProvince` is provided. If you specify the city, you must also send `postalCode` and `street`.
* @return the current {@code Address} instance, allowing for method chaining
*/
public Address city(String city) {
this.city = city;
return this;
}
/**
* The name of the city. Required if `stateOrProvince` is provided. If you specify the city, you must also send `postalCode` and `street`.
* @return city The name of the city. Required if `stateOrProvince` is provided. If you specify the city, you must also send `postalCode` and `street`.
*/
@JsonProperty(JSON_PROPERTY_CITY)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getCity() {
return city;
}
/**
* The name of the city. Required if `stateOrProvince` is provided. If you specify the city, you must also send `postalCode` and `street`.
*
* @param city The name of the city. Required if `stateOrProvince` is provided. If you specify the city, you must also send `postalCode` and `street`.
*/
@JsonProperty(JSON_PROPERTY_CITY)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setCity(String city) {
this.city = city;
}
/**
* The two-letter [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code.
*
* @param country The two-letter [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code.
* @return the current {@code Address} instance, allowing for method chaining
*/
public Address country(String country) {
this.country = country;
return this;
}
/**
* The two-letter [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code.
* @return country The two-letter [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code.
*/
@JsonProperty(JSON_PROPERTY_COUNTRY)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getCountry() {
return country;
}
/**
* The two-letter [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code.
*
* @param country The two-letter [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code.
*/
@JsonProperty(JSON_PROPERTY_COUNTRY)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setCountry(String country) {
this.country = country;
}
/**
* Postal code. Required if `stateOrProvince` and/or `city` is provided.
*
* @param postalCode Postal code. Required if `stateOrProvince` and/or `city` is provided.
* @return the current {@code Address} instance, allowing for method chaining
*/
public Address postalCode(String postalCode) {
this.postalCode = postalCode;
return this;
}
/**
* Postal code. Required if `stateOrProvince` and/or `city` is provided.
* @return postalCode Postal code. Required if `stateOrProvince` and/or `city` is provided.
*/
@JsonProperty(JSON_PROPERTY_POSTAL_CODE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getPostalCode() {
return postalCode;
}
/**
* Postal code. Required if `stateOrProvince` and/or `city` is provided.
*
* @param postalCode Postal code. Required if `stateOrProvince` and/or `city` is provided.
*/
@JsonProperty(JSON_PROPERTY_POSTAL_CODE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setPostalCode(String postalCode) {
this.postalCode = postalCode;
}
/**
* The two-letter ISO 3166-2 state or province code. For example, **CA** in the US. If you specify the state or province, you must also send `city`, `postalCode`, and `street`.
*
* @param stateOrProvince The two-letter ISO 3166-2 state or province code. For example, **CA** in the US. If you specify the state or province, you must also send `city`, `postalCode`, and `street`.
* @return the current {@code Address} instance, allowing for method chaining
*/
public Address stateOrProvince(String stateOrProvince) {
this.stateOrProvince = stateOrProvince;
return this;
}
/**
* The two-letter ISO 3166-2 state or province code. For example, **CA** in the US. If you specify the state or province, you must also send `city`, `postalCode`, and `street`.
* @return stateOrProvince The two-letter ISO 3166-2 state or province code. For example, **CA** in the US. If you specify the state or province, you must also send `city`, `postalCode`, and `street`.
*/
@JsonProperty(JSON_PROPERTY_STATE_OR_PROVINCE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getStateOrProvince() {
return stateOrProvince;
}
/**
* The two-letter ISO 3166-2 state or province code. For example, **CA** in the US. If you specify the state or province, you must also send `city`, `postalCode`, and `street`.
*
* @param stateOrProvince The two-letter ISO 3166-2 state or province code. For example, **CA** in the US. If you specify the state or province, you must also send `city`, `postalCode`, and `street`.
*/
@JsonProperty(JSON_PROPERTY_STATE_OR_PROVINCE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setStateOrProvince(String stateOrProvince) {
this.stateOrProvince = stateOrProvince;
}
/**
* The name of the street, and the house or building number. Required if `stateOrProvince` and/or `city` is provided.
*
* @param street The name of the street, and the house or building number. Required if `stateOrProvince` and/or `city` is provided.
* @return the current {@code Address} instance, allowing for method chaining
*/
public Address street(String street) {
this.street = street;
return this;
}
/**
* The name of the street, and the house or building number. Required if `stateOrProvince` and/or `city` is provided.
* @return street The name of the street, and the house or building number. Required if `stateOrProvince` and/or `city` is provided.
*/
@JsonProperty(JSON_PROPERTY_STREET)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getStreet() {
return street;
}
/**
* The name of the street, and the house or building number. Required if `stateOrProvince` and/or `city` is provided.
*
* @param street The name of the street, and the house or building number. Required if `stateOrProvince` and/or `city` is provided.
*/
@JsonProperty(JSON_PROPERTY_STREET)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setStreet(String street) {
this.street = street;
}
/**
* The apartment, unit, or suite number.
*
* @param street2 The apartment, unit, or suite number.
* @return the current {@code Address} instance, allowing for method chaining
*/
public Address street2(String street2) {
this.street2 = street2;
return this;
}
/**
* The apartment, unit, or suite number.
* @return street2 The apartment, unit, or suite number.
*/
@JsonProperty(JSON_PROPERTY_STREET2)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getStreet2() {
return street2;
}
/**
* The apartment, unit, or suite number.
*
* @param street2 The apartment, unit, or suite number.
*/
@JsonProperty(JSON_PROPERTY_STREET2)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setStreet2(String street2) {
this.street2 = street2;
}
/**
* Return true if this Address object is equal to o.
*/
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Address address = (Address) o;
return Objects.equals(this.city, address.city) &&
Objects.equals(this.country, address.country) &&
Objects.equals(this.postalCode, address.postalCode) &&
Objects.equals(this.stateOrProvince, address.stateOrProvince) &&
Objects.equals(this.street, address.street) &&
Objects.equals(this.street2, address.street2);
}
@Override
public int hashCode() {
return Objects.hash(city, country, postalCode, stateOrProvince, street, street2);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Address {\n");
sb.append(" city: ").append(toIndentedString(city)).append("\n");
sb.append(" country: ").append(toIndentedString(country)).append("\n");
sb.append(" postalCode: ").append(toIndentedString(postalCode)).append("\n");
sb.append(" stateOrProvince: ").append(toIndentedString(stateOrProvince)).append("\n");
sb.append(" street: ").append(toIndentedString(street)).append("\n");
sb.append(" street2: ").append(toIndentedString(street2)).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 Address given an JSON string
*
* @param jsonString JSON string
* @return An instance of Address
* @throws JsonProcessingException if the JSON string is invalid with respect to Address
*/
public static Address fromJson(String jsonString) throws JsonProcessingException {
return JSON.getMapper().readValue(jsonString, Address.class);
}
/**
* Convert an instance of Address to an JSON string
*
* @return JSON string
*/
public String toJson() throws JsonProcessingException {
return JSON.getMapper().writeValueAsString(this);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy