diff --git a/src/main/java/com/smartystreets/api/SmartySender.java b/src/main/java/com/smartystreets/api/SmartySender.java index 1acc127..d215c90 100644 --- a/src/main/java/com/smartystreets/api/SmartySender.java +++ b/src/main/java/com/smartystreets/api/SmartySender.java @@ -8,6 +8,7 @@ import java.io.IOException; import java.net.Proxy; import java.util.Map; +import java.util.Optional; import java.util.concurrent.TimeUnit; import java.util.logging.Handler; import java.util.logging.Level; @@ -61,7 +62,7 @@ private okhttp3.Request buildHttpRequest(Request smartyRequest) throws IOExcepti Map headers = smartyRequest.getHeaders(); Headers.Builder headersBuilder = new Headers.Builder(); for (String headerName : headers.keySet()) { - headersBuilder.add(headerName, headers.get(headerName).toString()); + headersBuilder.add(headerName, Optional.ofNullable(headers.get(headerName)).orElse("").toString()); } okhttp3.Request.Builder requestBuilder = new okhttp3.Request.Builder() diff --git a/src/main/java/com/smartystreets/api/us_street/Lookup.java b/src/main/java/com/smartystreets/api/us_street/Lookup.java index e59e42a..c4e7370 100644 --- a/src/main/java/com/smartystreets/api/us_street/Lookup.java +++ b/src/main/java/com/smartystreets/api/us_street/Lookup.java @@ -135,10 +135,14 @@ public String getMatch() { return null; } + /** + * This is a temporary flag meant to fix an intermittent data issue + * Unless explicitly instructed by the Smarty Tech Support team, DO NOT use this parameter + * + * @deprecated - Temporary - will be removed in a future release. + */ @JsonProperty("compatibility") public String getCompatibility() { - //This is a temporary flag meant to fix an intermittent data issue - //Unless explicitly instructed by the Smarty Tech Support team, DO NOT use this parameter return this.compatibility; } @@ -214,9 +218,13 @@ public void setUrbanization(String urbanization) { this.urbanization = urbanization; } + /** + * This is a temporary flag meant to fix an intermittent data issue + * Unless explicitly instructed by the Smarty Tech Support team, DO NOT use this parameter + * + * @deprecated - Temporary - will be removed in a future release. + */ public void setCompatibility(String compatibility) { - //This is a temporary flag meant to fix an intermittent data issue - //Unless explicitly instructed by the Smarty Tech Support team, DO NOT use this parameter this.compatibility = compatibility; } /** diff --git a/src/main/java/com/smartystreets/api/us_zipcode/Client.java b/src/main/java/com/smartystreets/api/us_zipcode/Client.java index c46cb24..ff716c0 100644 --- a/src/main/java/com/smartystreets/api/us_zipcode/Client.java +++ b/src/main/java/com/smartystreets/api/us_zipcode/Client.java @@ -57,6 +57,9 @@ private void populateQueryString(Lookup lookup, Request request) { request.putParameter("city", lookup.getCity()); request.putParameter("state", lookup.getState()); request.putParameter("zipcode", lookup.getZipCode()); + //This is a temporary flag meant to fix an intermittent data issue + //Unless explicitly instructed by the Smarty Tech Support team, DO NOT use this parameter + request.putParameter("compatibility", lookup.getCompatibility()); } diff --git a/src/main/java/com/smartystreets/api/us_zipcode/Lookup.java b/src/main/java/com/smartystreets/api/us_zipcode/Lookup.java index d15ce43..5e73ffd 100644 --- a/src/main/java/com/smartystreets/api/us_zipcode/Lookup.java +++ b/src/main/java/com/smartystreets/api/us_zipcode/Lookup.java @@ -20,6 +20,11 @@ public class Lookup implements Serializable { private String state; private String zipcode; + //This is a temporary flag meant to fix an intermittent data issue + //Unless explicitly instructed by the Smarty Tech Support team, DO NOT use this parameter + private String compatibility; + + //endregion public Lookup() { @@ -67,6 +72,16 @@ public String getInputId() { return this.inputId; } + /** + * This is a temporary flag meant to fix an intermittent data issue + * Unless explicitly instructed by the Smarty Tech Support team, DO NOT use this parameter + * + * @deprecated - Temporary - will be removed in a future release. + */ + public String getCompatibility() { + return this.compatibility; + } + //endregion //region [ Setters ] @@ -91,6 +106,16 @@ public void setZipCode(String zipcode) { this.zipcode = zipcode; } + /** + * This is a temporary flag meant to fix an intermittent data issue + * Unless explicitly instructed by the Smarty Tech Support team, DO NOT use this parameter + * + * * @deprecated - Temporary - will be removed in a future release. + */ + public void setCompatibility(String compatibility) { + this.compatibility = compatibility; + } + public Lookup setInputId(String inputId) { this.inputId = inputId; return this;