![JAR search and dependency download from the Maven repository](/logo.png)
co.aurasphere.botmill.fb.model.outcoming.template.receipt.Address Maven / Gradle / Ivy
/*
* MIT License
*
* Copyright (c) 2016 BotMill.io
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package co.aurasphere.botmill.fb.model.outcoming.template.receipt;
import java.io.Serializable;
import javax.validation.constraints.Pattern;
import org.hibernate.validator.constraints.NotBlank;
import com.google.gson.annotations.SerializedName;
/**
* The Class Address.
*/
public class Address implements Serializable {
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 1L;
/** The street 1. */
@NotBlank
@SerializedName("street_1")
private String street1;
/** The street 2. */
@SerializedName("street_2")
private String street2;
/** The city. */
@NotBlank
private String city;
/** The postal code. */
@NotBlank
@SerializedName("postal_code")
private String postalCode;
/** The state. */
@NotBlank
private String state;
/** The country. */
@NotBlank
@Pattern(regexp = "[A-Za-z]{2}", message = "{country.pattern.message}")
private String country;
/**
* Gets the street 1.
*
* @return the street 1
*/
public String getStreet1() {
return street1;
}
/**
* Sets the street 1.
*
* @param street1
* the new street 1
*/
public void setStreet1(String street1) {
this.street1 = street1;
}
/**
* Gets the street 2.
*
* @return the street 2
*/
public String getStreet2() {
return street2;
}
/**
* Sets the street 2.
*
* @param street2
* the new street 2
*/
public void setStreet2(String street2) {
this.street2 = street2;
}
/**
* Gets the city.
*
* @return the city
*/
public String getCity() {
return city;
}
/**
* Sets the city.
*
* @param city
* the new city
*/
public void setCity(String city) {
this.city = city;
}
/**
* Gets the postal code.
*
* @return the postal code
*/
public String getPostalCode() {
return postalCode;
}
/**
* Sets the postal code.
*
* @param postalCode
* the new postal code
*/
public void setPostalCode(String postalCode) {
this.postalCode = postalCode;
}
/**
* Gets the state.
*
* @return the state
*/
public String getState() {
return state;
}
/**
* Sets the state.
*
* @param state
* the new state
*/
public void setState(String state) {
this.state = state;
}
/**
* Gets the country.
*
* @return the country
*/
public String getCountry() {
return country;
}
/**
* Sets the country.
*
* @param country
* the new country
*/
public void setCountry(String country) {
this.country = country;
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((city == null) ? 0 : city.hashCode());
result = prime * result + ((country == null) ? 0 : country.hashCode());
result = prime * result
+ ((postalCode == null) ? 0 : postalCode.hashCode());
result = prime * result + ((state == null) ? 0 : state.hashCode());
result = prime * result + ((street1 == null) ? 0 : street1.hashCode());
result = prime * result + ((street2 == null) ? 0 : street2.hashCode());
return result;
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Address other = (Address) obj;
if (city == null) {
if (other.city != null)
return false;
} else if (!city.equals(other.city))
return false;
if (country == null) {
if (other.country != null)
return false;
} else if (!country.equals(other.country))
return false;
if (postalCode == null) {
if (other.postalCode != null)
return false;
} else if (!postalCode.equals(other.postalCode))
return false;
if (state == null) {
if (other.state != null)
return false;
} else if (!state.equals(other.state))
return false;
if (street1 == null) {
if (other.street1 != null)
return false;
} else if (!street1.equals(other.street1))
return false;
if (street2 == null) {
if (other.street2 != null)
return false;
} else if (!street2.equals(other.street2))
return false;
return true;
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
return "Address [street1=" + street1 + ", street2=" + street2
+ ", city=" + city + ", postalCode=" + postalCode + ", state="
+ state + ", country=" + country + "]";
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy