Class Address
Address of creditor or debtor.
You can either set street, house number, postal code and town (type <i>structured address</i>)
or address line 1 and 2 (type <i>combined address elements</i>). The type is automatically set
once any of these fields is set. Before setting the fields, the address type is <i>undetermined</i>.
If fields of both types are set, the address type becomes <i>conflicting</i>.
Name and country code must always be set unless all fields are empty.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clears all fields and sets the type toAddressType.Undetermined.booleanDetermines whether the specified object is equal to the current object.Gets the address line 1.Gets the address line 2.Gets the two-letter ISO country code.Gets the house number.getName()Gets the name, either the first and last name of a natural person or the company name of a legal person.Gets the postal code.Gets the street.getTown()Gets the town or city.getType()Gets the address type.inthashCode()Gets the hash code for this instance.voidsetAddressLine1(String value) Sets the address line 1.voidsetAddressLine2(String value) Sets the address line 2.voidsetCountryCode(String value) Sets the two-letter ISO country code.voidsetHouseNo(String value) Sets the house number.voidSets the name, either the first and last name of a natural person or the company name of a legal person.voidsetPostalCode(String value) Sets the postal code.voidSets the street.voidSets the town or city.
-
Constructor Details
-
Address
public Address()Creates instance of Address
-
-
Method Details
-
getType
Gets the address type.
The address type is automatically set by either setting street / house number or address line 1 and 2. Before setting the fields, the address type is
Value: The address type.<i>Undetermined</i>. If fields of both types are set, the address type becomes<i>Conflicting</i>. -
getName
Gets the name, either the first and last name of a natural person or the company name of a legal person.
Value: The name. -
setName
Sets the name, either the first and last name of a natural person or the company name of a legal person.
Value: The name. -
getAddressLine1
Gets the address line 1.
Address line 1 contains street name, house number or P.O. box.
Setting this field sets the address type to
AddressType.CombinedElementsunless it's alreadyAddressType.Structured, in which case it becomesAddressType.Conflicting.This field is only used for combined elements addresses and is optional.
Value: The address line 1. -
setAddressLine1
Sets the address line 1.
Address line 1 contains street name, house number or P.O. box.
Setting this field sets the address type to
AddressType.CombinedElementsunless it's alreadyAddressType.Structured, in which case it becomesAddressType.Conflicting.This field is only used for combined elements addresses and is optional.
Value: The address line 1. -
getAddressLine2
Gets the address line 2.
Address line 2 contains postal code and town.
Setting this field sets the address type to
AddressType.CombinedElementsunless it's alreadyAddressType.Structured, in which case it becomesAddressType.Conflicting.This field is only used for combined elements addresses. For this type, it's mandatory.
Value: The address line 2. -
setAddressLine2
Sets the address line 2.
Address line 2 contains postal code and town.
Setting this field sets the address type to
AddressType.CombinedElementsunless it's alreadyAddressType.Structured, in which case it becomesAddressType.Conflicting.This field is only used for combined elements addresses. For this type, it's mandatory.
Value: The address line 2. -
getStreet
Gets the street.
The street must be speicfied without house number.
Setting this field sets the address type to
AddressType.Structuredunless it's alreadyAddressType.CombinedElements, in which case it becomesAddressType.Conflicting.This field is only used for structured addresses and is optional.
Value: The street. -
setStreet
Sets the street.
The street must be speicfied without house number.
Setting this field sets the address type to
AddressType.Structuredunless it's alreadyAddressType.CombinedElements, in which case it becomesAddressType.Conflicting.This field is only used for structured addresses and is optional.
Value: The street. -
getHouseNo
Gets the house number.
Setting this field sets the address type to
AddressType.Structuredunless it's alreadyAddressType.CombinedElements, in which case it becomesAddressType.Conflicting.This field is only used for structured addresses and is optional.
Value: The house number. -
setHouseNo
Sets the house number.
Setting this field sets the address type to
AddressType.Structuredunless it's alreadyAddressType.CombinedElements, in which case it becomesAddressType.Conflicting.This field is only used for structured addresses and is optional.
Value: The house number. -
getPostalCode
Gets the postal code.
Setting this field sets the address type to
AddressType.Structuredunless it's alreadyAddressType.CombinedElements, in which case it becomesAddressType.Conflicting.This field is only used for structured addresses. For this type, it's mandatory.
Value: The postal code. -
setPostalCode
Sets the postal code.
Setting this field sets the address type to
AddressType.Structuredunless it's alreadyAddressType.CombinedElements, in which case it becomesAddressType.Conflicting.This field is only used for structured addresses. For this type, it's mandatory.
Value: The postal code. -
getTown
Gets the town or city.
Setting this field sets the address type to
AddressType.Structuredunless it's alreadyAddressType.CombinedElements, in which case it becomesAddressType.Conflicting.This field is only used for structured addresses. For this type, it's mandatory.
Value: The town or city. -
setTown
Sets the town or city.
Setting this field sets the address type to
AddressType.Structuredunless it's alreadyAddressType.CombinedElements, in which case it becomesAddressType.Conflicting.This field is only used for structured addresses. For this type, it's mandatory.
Value: The town or city. -
getCountryCode
Gets the two-letter ISO country code.
The country code is mandatory unless the entire address contains
Value: The ISO country code.nullor emtpy values. -
setCountryCode
Sets the two-letter ISO country code.
The country code is mandatory unless the entire address contains
Value: The ISO country code.nullor emtpy values. -
clear
public void clear()Clears all fields and sets the type to
AddressType.Undetermined. -
equals
Determines whether the specified object is equal to the current object.
-
hashCode
public int hashCode()Gets the hash code for this instance.
-