com.smartystreets.api.international_autocomplete.Lookup Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of smartystreets-java-sdk Show documentation
Show all versions of smartystreets-java-sdk Show documentation
A library to help Java developers easily access the SmartyStreets APIs.
package com.smartystreets.api.international_autocomplete;
import com.smartystreets.api.InternationalGeolocateType;
/**
* In addition to holding all of the input data for this lookup, this class also
* will contain the result of the lookup after it comes back from the API.
*
* @see "https://smartystreets.com/docs/cloud/international-address-autocomplete-api#http-request-input-fields"
*/
public class Lookup {
static final int MAX_RESULTS_DEFAULT = 5;
static final int DISTANCE_DEFAULT = 5;
//region [ Fields ]
private Candidate[] result;
private String country;
private String search;
private String addressID;
private int maxResults;
private String locality;
private String postalCode;
//endregion
//region [ Constructors ]
/**
* If you use this constructor, don't forget to set the prefix. It is required.
*/
public Lookup() {
this.maxResults = MAX_RESULTS_DEFAULT;
}
/**
* @param search The beginning of an address
*/
public Lookup(String search) {
this();
this.search = search;
}
//endregion
//region [ Getters ]
public Candidate[] getResult() {
return this.result;
}
public Candidate getResult(int index) {
return this.result[index];
}
public String getCountry() {
return this.country;
}
public String getSearch() {
return this.search;
}
public String getAddressID() {
return addressID;
}
public int getMaxResults() {
return this.maxResults;
}
public String getLocality() {
return this.locality;
}
public String getPostalCode() {
return this.postalCode;
}
//endregion
//region [ Setters ]
public void setResult(Candidate[] result) {
this.result = result;
}
public void setCountry(String country) {
this.country = country;
}
public void setSearch(String search) {
this.search = search;
}
public void setAddressID(String addressID) {
this.addressID = addressID;
}
public void setMaxResults(int maxResults) {
this.maxResults = maxResults;
}
public void setLocality(String locality) {
this.locality = locality;
}
public void setPostalCode(String postalCode) {
this.postalCode = postalCode;
}
//endregion
}