com.aspose.barcode.complexbarcode

Class Address

  • java.lang.Object
    • com.aspose.barcode.complexbarcode.Address


  • public final class Address
    extends java.lang.Object

    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 
      Constructor and Description
      Address()
      Creates instance of Address
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void clear()
      Clears all fields and sets the type to AddressType.Undetermined.
      boolean equals(Address other)
      Determines whether the specified address is equal to the current address.
      boolean equals(java.lang.Object obj)
      Determines whether the specified object is equal to the current object.
      java.lang.String getAddressLine1()
      Gets the address line 1.
      java.lang.String getAddressLine2()
      Gets the address line 2.
      java.lang.String getCountryCode()
      Gets the two-letter ISO country code.
      java.lang.String getHouseNo()
      Gets the house number.
      java.lang.String getName()
      Gets the name, either the first and last name of a natural person or the company name of a legal person.
      java.lang.String getPostalCode()
      Gets the postal code.
      java.lang.String getStreet()
      Gets the street.
      java.lang.String getTown()
      Gets the town or city.
      AddressType getType()
      Gets the address type.
      int hashCode()
      Gets the hash code for this instance.
      void setAddressLine1(java.lang.String value)
      Sets the address line 1.
      void setAddressLine2(java.lang.String value)
      Sets the address line 2.
      void setCountryCode(java.lang.String value)
      Sets the two-letter ISO country code.
      void setHouseNo(java.lang.String value)
      Sets the house number.
      void setName(java.lang.String value)
      Sets the name, either the first and last name of a natural person or the company name of a legal person.
      void setPostalCode(java.lang.String value)
      Sets the postal code.
      void setStreet(java.lang.String value)
      Sets the street.
      void setTown(java.lang.String value)
      Sets the town or city.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Address

        public Address()

        Creates instance of Address

    • Method Detail

      • getType

        public AddressType 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 <i>Undetermined</i>. If fields of both types are set, the address type becomes <i>Conflicting</i>.

        Value: The address type.
      • getName

        public java.lang.String 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

        public void setName(java.lang.String value)

        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

        public java.lang.String 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.CombinedElements unless it's already AddressType.Structured, in which case it becomes AddressType.Conflicting.

        This field is only used for combined elements addresses and is optional.

        Value: The address line 1.
      • setAddressLine1

        public void setAddressLine1(java.lang.String value)

        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.CombinedElements unless it's already AddressType.Structured, in which case it becomes AddressType.Conflicting.

        This field is only used for combined elements addresses and is optional.

        Value: The address line 1.
      • getAddressLine2

        public java.lang.String getAddressLine2()

        Gets the address line 2.

        Address line 2 contains postal code and town.

        Setting this field sets the address type to AddressType.CombinedElements unless it's already AddressType.Structured, in which case it becomes AddressType.Conflicting.

        This field is only used for combined elements addresses. For this type, it's mandatory.

        Value: The address line 2.
      • setAddressLine2

        public void setAddressLine2(java.lang.String value)

        Sets the address line 2.

        Address line 2 contains postal code and town.

        Setting this field sets the address type to AddressType.CombinedElements unless it's already AddressType.Structured, in which case it becomes AddressType.Conflicting.

        This field is only used for combined elements addresses. For this type, it's mandatory.

        Value: The address line 2.
      • getStreet

        public java.lang.String getStreet()

        Gets the street.

        The street must be speicfied without house number.

        Setting this field sets the address type to AddressType.Structured unless it's already AddressType.CombinedElements, in which case it becomes AddressType.Conflicting.

        This field is only used for structured addresses and is optional.

        Value: The street.
      • setStreet

        public void setStreet(java.lang.String value)

        Sets the street.

        The street must be speicfied without house number.

        Setting this field sets the address type to AddressType.Structured unless it's already AddressType.CombinedElements, in which case it becomes AddressType.Conflicting.

        This field is only used for structured addresses and is optional.

        Value: The street.
      • getHouseNo

        public java.lang.String getHouseNo()

        Gets the house number.

        Setting this field sets the address type to AddressType.Structured unless it's already AddressType.CombinedElements, in which case it becomes AddressType.Conflicting.

        This field is only used for structured addresses and is optional.

        Value: The house number.
      • setHouseNo

        public void setHouseNo(java.lang.String value)

        Sets the house number.

        Setting this field sets the address type to AddressType.Structured unless it's already AddressType.CombinedElements, in which case it becomes AddressType.Conflicting.

        This field is only used for structured addresses and is optional.

        Value: The house number.
      • getPostalCode

        public java.lang.String getPostalCode()

        Gets the postal code.

        Setting this field sets the address type to AddressType.Structured unless it's already AddressType.CombinedElements, in which case it becomes AddressType.Conflicting.

        This field is only used for structured addresses. For this type, it's mandatory.

        Value: The postal code.
      • setPostalCode

        public void setPostalCode(java.lang.String value)

        Sets the postal code.

        Setting this field sets the address type to AddressType.Structured unless it's already AddressType.CombinedElements, in which case it becomes AddressType.Conflicting.

        This field is only used for structured addresses. For this type, it's mandatory.

        Value: The postal code.
      • getTown

        public java.lang.String getTown()

        Gets the town or city.

        Setting this field sets the address type to AddressType.Structured unless it's already AddressType.CombinedElements, in which case it becomes AddressType.Conflicting.

        This field is only used for structured addresses. For this type, it's mandatory.

        Value: The town or city.
      • setTown

        public void setTown(java.lang.String value)

        Sets the town or city.

        Setting this field sets the address type to AddressType.Structured unless it's already AddressType.CombinedElements, in which case it becomes AddressType.Conflicting.

        This field is only used for structured addresses. For this type, it's mandatory.

        Value: The town or city.
      • getCountryCode

        public java.lang.String getCountryCode()

        Gets the two-letter ISO country code.

        The country code is mandatory unless the entire address contains null or emtpy values.

        Value: The ISO country code.
      • setCountryCode

        public void setCountryCode(java.lang.String value)

        Sets the two-letter ISO country code.

        The country code is mandatory unless the entire address contains null or emtpy values.

        Value: The ISO country code.
      • clear

        public void clear()

        Clears all fields and sets the type to AddressType.Undetermined.

      • equals

        public boolean equals(java.lang.Object obj)

        Determines whether the specified object is equal to the current object.

        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj - The object to compare with the current object.
        Returns:
        true if the specified object is equal to the current object; otherwise, false.
      • equals

        public boolean equals(Address other)

        Determines whether the specified address is equal to the current address.

        Parameters:
        other - The address to compare with the current address.
        Returns:
        true if the specified object is equal to the current object; otherwise, false.
      • hashCode

        public int hashCode()

        Gets the hash code for this instance.

        Overrides:
        hashCode in class java.lang.Object
        Returns:
        A hash code for the current object.