com.avalara.avatax.services.address
Class Address

java.lang.Object
  extended by com.avalara.avatax.services.address.Address
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ValidAddress

public class Address
extends java.lang.Object
implements java.io.Serializable

Contains address data; Can be passed to AddressSvcSoap.validate(com.avalara.avatax.services.address.ValidateRequest) using ValidateRequest; Also part of the GetTaxRequest result returned from the TaxSvcSoap.getTax(com.avalara.avatax.services.tax.GetTaxRequest) tax calculation service.

Example:

 [Java]
  EngineConfiguration config = new FileProvider("avatax4j.wsdd");
  AddressSvc AddressSvc = new AddressSvcLocator(config);

  AddressSvcSoap port = AddressSvc.getAddressSvcSoap(new URL("http://www.avalara.com/services/"));

  // Set the profile
  Profile profile = new Profile();
  profile.setClient("AddressSvcTest,4.0.0.0");
  port.setProfile(profile);

  // Set security
  Security security = new Security();
  security.setAccount("account");
  security.setLicense("license number");
  port.setSecurity(security);

  ValidateRequest request = new ValidateRequest();
  Address address = new Address();
  address.setLine1("900 Winslow Way");
  address.setLine2("Suite 130");
  address.setCity("Bainbridge Is");
  address.setRegion("WA");
  address.setPostalCode("98110-2450");
  request.setAddress(address);
  request.setTextCase(TextCase.Upper);

  ValidateResult result;
  result = port.validate(request);
  Address[] addresses = result.getValidAddresses().getValidAddress();
  System.out.println("Number of addresses returned is " +
         addresses == null ? "0" : Integer.toString(addresses.length));

 

See Also:
Serialized Form

Constructor Summary
Address()
          Initializes a new instance of the class.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Overrides the default implementation of Object.equals(java.lang.Object).
 java.lang.String getAddressCode()
          Programmatically determined value used internally by the adapter.
 java.lang.String getCity()
          City name.
 java.lang.String getCountry()
          Country name.
static org.apache.axis.encoding.Deserializer getDeserializer(java.lang.String mechType, java.lang.Class _javaType, javax.xml.namespace.QName _xmlType)
          Get Custom Deserializer for this object for use with Axis.
 java.lang.String getLine1()
          Address line 1 value.
 java.lang.String getLine2()
          Address line 2.
 java.lang.String getLine3()
          Address line 3.
 java.lang.String getPostalCode()
          Postal or ZIP code.
 java.lang.String getRegion()
          State or province name or abbreviation.
static org.apache.axis.encoding.Serializer getSerializer(java.lang.String mechType, java.lang.Class _javaType, javax.xml.namespace.QName _xmlType)
          Get Custom Serializer for this object for use with Axis.
 int getTaxRegionId()
          Gets the taxRegionId value for this BaseAddress.
static org.apache.axis.description.TypeDesc getTypeDesc()
          Return TypeDesc metadata object for use with Axis.
 int hashCode()
          Gets the default hash code for the object (as returned by Object.hashCode())
 void setAddressCode(java.lang.String addressCode)
          Programmatically determined value used internally by the adapter.
 void setCity(java.lang.String city)
          City name.
 void setCountry(java.lang.String country)
          Country name.
 void setLine1(java.lang.String line1)
          Address line 1.
 void setLine2(java.lang.String line2)
          Address line 2.
 void setLine3(java.lang.String line3)
          Address line 3.
 void setPostalCode(java.lang.String postalCode)
          Postal or ZIP code.
 void setRegion(java.lang.String region)
          State or province name or abbreviation.
 void setTaxRegionId(int taxRegionId)
          Sets the taxRegionId value for this BaseAddress.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Address

public Address()
Initializes a new instance of the class.

Method Detail

getAddressCode

public java.lang.String getAddressCode()
Programmatically determined value used internally by the adapter. Defaults to the hash code of this Address object.

Returns:
addressCode

setAddressCode

public void setAddressCode(java.lang.String addressCode)
Programmatically determined value used internally by the adapter. Defaults to the hash code of this Address object.

Parameters:
addressCode -

getLine1

public java.lang.String getLine1()
Address line 1 value.

Returns:
Address line 1 value

setLine1

public void setLine1(java.lang.String line1)
Address line 1.

Parameters:
line1 - address line 1

getLine2

public java.lang.String getLine2()
Address line 2.

Returns:
line2 - address line 2

setLine2

public void setLine2(java.lang.String line2)
Address line 2.

Parameters:
line2 - Address line 2.

getLine3

public java.lang.String getLine3()
Address line 3.

Returns:
line3 - address line 3

setLine3

public void setLine3(java.lang.String line3)
Address line 3.

Parameters:
line3 - Address line 3

getCity

public java.lang.String getCity()
City name.

Returns:
city - City name

setCity

public void setCity(java.lang.String city)
City name.

Parameters:
city - city name

getRegion

public java.lang.String getRegion()
State or province name or abbreviation.

Returns:
region - state or province name or abbreviation

setRegion

public void setRegion(java.lang.String region)
State or province name or abbreviation.

Parameters:
region - - state or province name or abbreviation

getPostalCode

public java.lang.String getPostalCode()
Postal or ZIP code.

Returns:
postalCode - Postal or ZIP code

setPostalCode

public void setPostalCode(java.lang.String postalCode)
Postal or ZIP code.

Parameters:
postalCode - - Postal or ZIP code

getCountry

public java.lang.String getCountry()
Country name.

Returns:
country - country name

setCountry

public void setCountry(java.lang.String country)
Country name.

Parameters:
country - - country name

getTaxRegionId

public int getTaxRegionId()
Gets the taxRegionId value for this BaseAddress.

Returns:
taxRegionId

setTaxRegionId

public void setTaxRegionId(int taxRegionId)
Sets the taxRegionId value for this BaseAddress.

TaxRegionId provides the ability to override the tax region assignment for an address.

Parameters:
taxRegionId -

equals

public boolean equals(java.lang.Object obj)
Overrides the default implementation of Object.equals(java.lang.Object).

Equality is determined by first comparing referential equality (they are the same object). Returns true if the two objects are referentially equal. If they are not, then it tests that the object passed into the Equals method is an Address object. Returns false if the compare object is not of type Address. Otherwise, it will compare the two objects on a field by field basis, such that Line1 is compared to Line1 of the compare object, Line2 to Line2 of the compare object, and so on. All fields must be identical (case-insensitive) in order for the two objects to be considered equal.

Example: The following will return true:

 [Java]
 Address address1 = new Address();
 address1.Line1 = "900 Winslow Way";
 address1.Region = "WA";
 address1.PostalCode = "98110";

 Address address2 = address1;
 bool isEqual = address1.Equals(address2);

 

The following will also return true:

 [Java]
 Address address1 = new Address();
 address1.Line1 = "900 Winslow Way";
 address1.Region = "WA";
 address1.PostalCode = "98110";

 Address address2 = new Address();
 address2.Line1 = "900 WINSLOW WAY";
 address2.Region = "wa";
 address2.PostalCode = "98110";

 bool isEqual = address1.Equals(address2);
 

Overrides:
equals in class java.lang.Object
Parameters:
obj - The object to compare.
Returns:
True if obj is a reference to this object or if both objects contain the same values (case-insensitive).
False if they do not contain the same values or obj is not of type Address.

hashCode

public int hashCode()
Gets the default hash code for the object (as returned by Object.hashCode())

Overrides:
hashCode in class java.lang.Object
Returns:
- A default hash code.

getTypeDesc

public static org.apache.axis.description.TypeDesc getTypeDesc()
Return TypeDesc metadata object for use with Axis.

See Also:
TypeDesc

getSerializer

public static org.apache.axis.encoding.Serializer getSerializer(java.lang.String mechType,
                                                                java.lang.Class _javaType,
                                                                javax.xml.namespace.QName _xmlType)
Get Custom Serializer for this object for use with Axis.

See Also:
Serializer

getDeserializer

public static org.apache.axis.encoding.Deserializer getDeserializer(java.lang.String mechType,
                                                                    java.lang.Class _javaType,
                                                                    javax.xml.namespace.QName _xmlType)
Get Custom Deserializer for this object for use with Axis.

See Also:
Deserializer