com.amazonaws.services.snowball.model.Address Maven / Gradle / Ivy
Show all versions of aws-java-sdk-snowball Show documentation
/*
* Copyright 2019-2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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 com.amazonaws.services.snowball.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* The address that you want the Snow device(s) associated with a specific job to be shipped to. Addresses are validated
* at the time of creation. The address you provide must be located within the serviceable area of your region. Although
* no individual elements of the Address
are required, if the address is invalid or unsupported, then an
* exception is thrown.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class Address implements Serializable, Cloneable, StructuredPojo {
/**
*
* The unique ID for an address.
*
*/
private String addressId;
/**
*
* The name of a person to receive a Snow device at an address.
*
*/
private String name;
/**
*
* The name of the company to receive a Snow device at an address.
*
*/
private String company;
/**
*
* The first line in a street address that a Snow device is to be delivered to.
*
*/
private String street1;
/**
*
* The second line in a street address that a Snow device is to be delivered to.
*
*/
private String street2;
/**
*
* The third line in a street address that a Snow device is to be delivered to.
*
*/
private String street3;
/**
*
* The city in an address that a Snow device is to be delivered to.
*
*/
private String city;
/**
*
* The state or province in an address that a Snow device is to be delivered to.
*
*/
private String stateOrProvince;
/**
*
* This field is no longer used and the value is ignored.
*
*/
private String prefectureOrDistrict;
/**
*
* This field is no longer used and the value is ignored.
*
*/
private String landmark;
/**
*
* The country in an address that a Snow device is to be delivered to.
*
*/
private String country;
/**
*
* The postal code in an address that a Snow device is to be delivered to.
*
*/
private String postalCode;
/**
*
* The phone number associated with an address that a Snow device is to be delivered to.
*
*/
private String phoneNumber;
/**
*
* If the address you are creating is a primary address, then set this option to true. This field is not supported
* in most regions.
*
*/
private Boolean isRestricted;
/**
*
* Differentiates between delivery address and pickup address in the customer account. Provided at job creation.
*
*/
private String type;
/**
*
* The unique ID for an address.
*
*
* @param addressId
* The unique ID for an address.
*/
public void setAddressId(String addressId) {
this.addressId = addressId;
}
/**
*
* The unique ID for an address.
*
*
* @return The unique ID for an address.
*/
public String getAddressId() {
return this.addressId;
}
/**
*
* The unique ID for an address.
*
*
* @param addressId
* The unique ID for an address.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Address withAddressId(String addressId) {
setAddressId(addressId);
return this;
}
/**
*
* The name of a person to receive a Snow device at an address.
*
*
* @param name
* The name of a person to receive a Snow device at an address.
*/
public void setName(String name) {
this.name = name;
}
/**
*
* The name of a person to receive a Snow device at an address.
*
*
* @return The name of a person to receive a Snow device at an address.
*/
public String getName() {
return this.name;
}
/**
*
* The name of a person to receive a Snow device at an address.
*
*
* @param name
* The name of a person to receive a Snow device at an address.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Address withName(String name) {
setName(name);
return this;
}
/**
*
* The name of the company to receive a Snow device at an address.
*
*
* @param company
* The name of the company to receive a Snow device at an address.
*/
public void setCompany(String company) {
this.company = company;
}
/**
*
* The name of the company to receive a Snow device at an address.
*
*
* @return The name of the company to receive a Snow device at an address.
*/
public String getCompany() {
return this.company;
}
/**
*
* The name of the company to receive a Snow device at an address.
*
*
* @param company
* The name of the company to receive a Snow device at an address.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Address withCompany(String company) {
setCompany(company);
return this;
}
/**
*
* The first line in a street address that a Snow device is to be delivered to.
*
*
* @param street1
* The first line in a street address that a Snow device is to be delivered to.
*/
public void setStreet1(String street1) {
this.street1 = street1;
}
/**
*
* The first line in a street address that a Snow device is to be delivered to.
*
*
* @return The first line in a street address that a Snow device is to be delivered to.
*/
public String getStreet1() {
return this.street1;
}
/**
*
* The first line in a street address that a Snow device is to be delivered to.
*
*
* @param street1
* The first line in a street address that a Snow device is to be delivered to.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Address withStreet1(String street1) {
setStreet1(street1);
return this;
}
/**
*
* The second line in a street address that a Snow device is to be delivered to.
*
*
* @param street2
* The second line in a street address that a Snow device is to be delivered to.
*/
public void setStreet2(String street2) {
this.street2 = street2;
}
/**
*
* The second line in a street address that a Snow device is to be delivered to.
*
*
* @return The second line in a street address that a Snow device is to be delivered to.
*/
public String getStreet2() {
return this.street2;
}
/**
*
* The second line in a street address that a Snow device is to be delivered to.
*
*
* @param street2
* The second line in a street address that a Snow device is to be delivered to.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Address withStreet2(String street2) {
setStreet2(street2);
return this;
}
/**
*
* The third line in a street address that a Snow device is to be delivered to.
*
*
* @param street3
* The third line in a street address that a Snow device is to be delivered to.
*/
public void setStreet3(String street3) {
this.street3 = street3;
}
/**
*
* The third line in a street address that a Snow device is to be delivered to.
*
*
* @return The third line in a street address that a Snow device is to be delivered to.
*/
public String getStreet3() {
return this.street3;
}
/**
*
* The third line in a street address that a Snow device is to be delivered to.
*
*
* @param street3
* The third line in a street address that a Snow device is to be delivered to.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Address withStreet3(String street3) {
setStreet3(street3);
return this;
}
/**
*
* The city in an address that a Snow device is to be delivered to.
*
*
* @param city
* The city in an address that a Snow device is to be delivered to.
*/
public void setCity(String city) {
this.city = city;
}
/**
*
* The city in an address that a Snow device is to be delivered to.
*
*
* @return The city in an address that a Snow device is to be delivered to.
*/
public String getCity() {
return this.city;
}
/**
*
* The city in an address that a Snow device is to be delivered to.
*
*
* @param city
* The city in an address that a Snow device is to be delivered to.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Address withCity(String city) {
setCity(city);
return this;
}
/**
*
* The state or province in an address that a Snow device is to be delivered to.
*
*
* @param stateOrProvince
* The state or province in an address that a Snow device is to be delivered to.
*/
public void setStateOrProvince(String stateOrProvince) {
this.stateOrProvince = stateOrProvince;
}
/**
*
* The state or province in an address that a Snow device is to be delivered to.
*
*
* @return The state or province in an address that a Snow device is to be delivered to.
*/
public String getStateOrProvince() {
return this.stateOrProvince;
}
/**
*
* The state or province in an address that a Snow device is to be delivered to.
*
*
* @param stateOrProvince
* The state or province in an address that a Snow device is to be delivered to.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Address withStateOrProvince(String stateOrProvince) {
setStateOrProvince(stateOrProvince);
return this;
}
/**
*
* This field is no longer used and the value is ignored.
*
*
* @param prefectureOrDistrict
* This field is no longer used and the value is ignored.
*/
public void setPrefectureOrDistrict(String prefectureOrDistrict) {
this.prefectureOrDistrict = prefectureOrDistrict;
}
/**
*
* This field is no longer used and the value is ignored.
*
*
* @return This field is no longer used and the value is ignored.
*/
public String getPrefectureOrDistrict() {
return this.prefectureOrDistrict;
}
/**
*
* This field is no longer used and the value is ignored.
*
*
* @param prefectureOrDistrict
* This field is no longer used and the value is ignored.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Address withPrefectureOrDistrict(String prefectureOrDistrict) {
setPrefectureOrDistrict(prefectureOrDistrict);
return this;
}
/**
*
* This field is no longer used and the value is ignored.
*
*
* @param landmark
* This field is no longer used and the value is ignored.
*/
public void setLandmark(String landmark) {
this.landmark = landmark;
}
/**
*
* This field is no longer used and the value is ignored.
*
*
* @return This field is no longer used and the value is ignored.
*/
public String getLandmark() {
return this.landmark;
}
/**
*
* This field is no longer used and the value is ignored.
*
*
* @param landmark
* This field is no longer used and the value is ignored.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Address withLandmark(String landmark) {
setLandmark(landmark);
return this;
}
/**
*
* The country in an address that a Snow device is to be delivered to.
*
*
* @param country
* The country in an address that a Snow device is to be delivered to.
*/
public void setCountry(String country) {
this.country = country;
}
/**
*
* The country in an address that a Snow device is to be delivered to.
*
*
* @return The country in an address that a Snow device is to be delivered to.
*/
public String getCountry() {
return this.country;
}
/**
*
* The country in an address that a Snow device is to be delivered to.
*
*
* @param country
* The country in an address that a Snow device is to be delivered to.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Address withCountry(String country) {
setCountry(country);
return this;
}
/**
*
* The postal code in an address that a Snow device is to be delivered to.
*
*
* @param postalCode
* The postal code in an address that a Snow device is to be delivered to.
*/
public void setPostalCode(String postalCode) {
this.postalCode = postalCode;
}
/**
*
* The postal code in an address that a Snow device is to be delivered to.
*
*
* @return The postal code in an address that a Snow device is to be delivered to.
*/
public String getPostalCode() {
return this.postalCode;
}
/**
*
* The postal code in an address that a Snow device is to be delivered to.
*
*
* @param postalCode
* The postal code in an address that a Snow device is to be delivered to.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Address withPostalCode(String postalCode) {
setPostalCode(postalCode);
return this;
}
/**
*
* The phone number associated with an address that a Snow device is to be delivered to.
*
*
* @param phoneNumber
* The phone number associated with an address that a Snow device is to be delivered to.
*/
public void setPhoneNumber(String phoneNumber) {
this.phoneNumber = phoneNumber;
}
/**
*
* The phone number associated with an address that a Snow device is to be delivered to.
*
*
* @return The phone number associated with an address that a Snow device is to be delivered to.
*/
public String getPhoneNumber() {
return this.phoneNumber;
}
/**
*
* The phone number associated with an address that a Snow device is to be delivered to.
*
*
* @param phoneNumber
* The phone number associated with an address that a Snow device is to be delivered to.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Address withPhoneNumber(String phoneNumber) {
setPhoneNumber(phoneNumber);
return this;
}
/**
*
* If the address you are creating is a primary address, then set this option to true. This field is not supported
* in most regions.
*
*
* @param isRestricted
* If the address you are creating is a primary address, then set this option to true. This field is not
* supported in most regions.
*/
public void setIsRestricted(Boolean isRestricted) {
this.isRestricted = isRestricted;
}
/**
*
* If the address you are creating is a primary address, then set this option to true. This field is not supported
* in most regions.
*
*
* @return If the address you are creating is a primary address, then set this option to true. This field is not
* supported in most regions.
*/
public Boolean getIsRestricted() {
return this.isRestricted;
}
/**
*
* If the address you are creating is a primary address, then set this option to true. This field is not supported
* in most regions.
*
*
* @param isRestricted
* If the address you are creating is a primary address, then set this option to true. This field is not
* supported in most regions.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Address withIsRestricted(Boolean isRestricted) {
setIsRestricted(isRestricted);
return this;
}
/**
*
* If the address you are creating is a primary address, then set this option to true. This field is not supported
* in most regions.
*
*
* @return If the address you are creating is a primary address, then set this option to true. This field is not
* supported in most regions.
*/
public Boolean isRestricted() {
return this.isRestricted;
}
/**
*
* Differentiates between delivery address and pickup address in the customer account. Provided at job creation.
*
*
* @param type
* Differentiates between delivery address and pickup address in the customer account. Provided at job
* creation.
* @see AddressType
*/
public void setType(String type) {
this.type = type;
}
/**
*
* Differentiates between delivery address and pickup address in the customer account. Provided at job creation.
*
*
* @return Differentiates between delivery address and pickup address in the customer account. Provided at job
* creation.
* @see AddressType
*/
public String getType() {
return this.type;
}
/**
*
* Differentiates between delivery address and pickup address in the customer account. Provided at job creation.
*
*
* @param type
* Differentiates between delivery address and pickup address in the customer account. Provided at job
* creation.
* @return Returns a reference to this object so that method calls can be chained together.
* @see AddressType
*/
public Address withType(String type) {
setType(type);
return this;
}
/**
*
* Differentiates between delivery address and pickup address in the customer account. Provided at job creation.
*
*
* @param type
* Differentiates between delivery address and pickup address in the customer account. Provided at job
* creation.
* @return Returns a reference to this object so that method calls can be chained together.
* @see AddressType
*/
public Address withType(AddressType type) {
this.type = type.toString();
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getAddressId() != null)
sb.append("AddressId: ").append(getAddressId()).append(",");
if (getName() != null)
sb.append("Name: ").append(getName()).append(",");
if (getCompany() != null)
sb.append("Company: ").append(getCompany()).append(",");
if (getStreet1() != null)
sb.append("Street1: ").append(getStreet1()).append(",");
if (getStreet2() != null)
sb.append("Street2: ").append(getStreet2()).append(",");
if (getStreet3() != null)
sb.append("Street3: ").append(getStreet3()).append(",");
if (getCity() != null)
sb.append("City: ").append(getCity()).append(",");
if (getStateOrProvince() != null)
sb.append("StateOrProvince: ").append(getStateOrProvince()).append(",");
if (getPrefectureOrDistrict() != null)
sb.append("PrefectureOrDistrict: ").append(getPrefectureOrDistrict()).append(",");
if (getLandmark() != null)
sb.append("Landmark: ").append(getLandmark()).append(",");
if (getCountry() != null)
sb.append("Country: ").append(getCountry()).append(",");
if (getPostalCode() != null)
sb.append("PostalCode: ").append(getPostalCode()).append(",");
if (getPhoneNumber() != null)
sb.append("PhoneNumber: ").append(getPhoneNumber()).append(",");
if (getIsRestricted() != null)
sb.append("IsRestricted: ").append(getIsRestricted()).append(",");
if (getType() != null)
sb.append("Type: ").append(getType());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof Address == false)
return false;
Address other = (Address) obj;
if (other.getAddressId() == null ^ this.getAddressId() == null)
return false;
if (other.getAddressId() != null && other.getAddressId().equals(this.getAddressId()) == false)
return false;
if (other.getName() == null ^ this.getName() == null)
return false;
if (other.getName() != null && other.getName().equals(this.getName()) == false)
return false;
if (other.getCompany() == null ^ this.getCompany() == null)
return false;
if (other.getCompany() != null && other.getCompany().equals(this.getCompany()) == false)
return false;
if (other.getStreet1() == null ^ this.getStreet1() == null)
return false;
if (other.getStreet1() != null && other.getStreet1().equals(this.getStreet1()) == false)
return false;
if (other.getStreet2() == null ^ this.getStreet2() == null)
return false;
if (other.getStreet2() != null && other.getStreet2().equals(this.getStreet2()) == false)
return false;
if (other.getStreet3() == null ^ this.getStreet3() == null)
return false;
if (other.getStreet3() != null && other.getStreet3().equals(this.getStreet3()) == false)
return false;
if (other.getCity() == null ^ this.getCity() == null)
return false;
if (other.getCity() != null && other.getCity().equals(this.getCity()) == false)
return false;
if (other.getStateOrProvince() == null ^ this.getStateOrProvince() == null)
return false;
if (other.getStateOrProvince() != null && other.getStateOrProvince().equals(this.getStateOrProvince()) == false)
return false;
if (other.getPrefectureOrDistrict() == null ^ this.getPrefectureOrDistrict() == null)
return false;
if (other.getPrefectureOrDistrict() != null && other.getPrefectureOrDistrict().equals(this.getPrefectureOrDistrict()) == false)
return false;
if (other.getLandmark() == null ^ this.getLandmark() == null)
return false;
if (other.getLandmark() != null && other.getLandmark().equals(this.getLandmark()) == false)
return false;
if (other.getCountry() == null ^ this.getCountry() == null)
return false;
if (other.getCountry() != null && other.getCountry().equals(this.getCountry()) == false)
return false;
if (other.getPostalCode() == null ^ this.getPostalCode() == null)
return false;
if (other.getPostalCode() != null && other.getPostalCode().equals(this.getPostalCode()) == false)
return false;
if (other.getPhoneNumber() == null ^ this.getPhoneNumber() == null)
return false;
if (other.getPhoneNumber() != null && other.getPhoneNumber().equals(this.getPhoneNumber()) == false)
return false;
if (other.getIsRestricted() == null ^ this.getIsRestricted() == null)
return false;
if (other.getIsRestricted() != null && other.getIsRestricted().equals(this.getIsRestricted()) == false)
return false;
if (other.getType() == null ^ this.getType() == null)
return false;
if (other.getType() != null && other.getType().equals(this.getType()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getAddressId() == null) ? 0 : getAddressId().hashCode());
hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
hashCode = prime * hashCode + ((getCompany() == null) ? 0 : getCompany().hashCode());
hashCode = prime * hashCode + ((getStreet1() == null) ? 0 : getStreet1().hashCode());
hashCode = prime * hashCode + ((getStreet2() == null) ? 0 : getStreet2().hashCode());
hashCode = prime * hashCode + ((getStreet3() == null) ? 0 : getStreet3().hashCode());
hashCode = prime * hashCode + ((getCity() == null) ? 0 : getCity().hashCode());
hashCode = prime * hashCode + ((getStateOrProvince() == null) ? 0 : getStateOrProvince().hashCode());
hashCode = prime * hashCode + ((getPrefectureOrDistrict() == null) ? 0 : getPrefectureOrDistrict().hashCode());
hashCode = prime * hashCode + ((getLandmark() == null) ? 0 : getLandmark().hashCode());
hashCode = prime * hashCode + ((getCountry() == null) ? 0 : getCountry().hashCode());
hashCode = prime * hashCode + ((getPostalCode() == null) ? 0 : getPostalCode().hashCode());
hashCode = prime * hashCode + ((getPhoneNumber() == null) ? 0 : getPhoneNumber().hashCode());
hashCode = prime * hashCode + ((getIsRestricted() == null) ? 0 : getIsRestricted().hashCode());
hashCode = prime * hashCode + ((getType() == null) ? 0 : getType().hashCode());
return hashCode;
}
@Override
public Address clone() {
try {
return (Address) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.snowball.model.transform.AddressMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}