Interface ContactModifier

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      ContactModifier addAssignedAddresses​(javax.mail.internet.InternetAddress... emailAddresses)
      Add email addresses to the associated Contact.
      ContactModifier addAssignedPhoneNumbers​(java.lang.String... phoneNumbers)
      Add phone numbers to the associated Contact.
      ContactModifier addAttributes​(java.lang.String attributeName, java.lang.String... attributeValues)
      Add attributes which can be used for identification to the associated Contact (see ContactIdentifier for further information).
      java.util.Set<javax.mail.internet.InternetAddress> getAssignedAddresses()
      Returns an unmodifiable cached view of the assigned email addresses.
      java.util.Set<java.lang.String> getAssignedPhoneNumbers()
      Returns an unmodifiable cached view of the assigned phone numbers as Fully Qualified Telephone Numbers according to ITU-T standard E.164 (e.g.
      java.util.Map<java.lang.String,​java.util.Set<java.lang.String>> getAttributes()
      Returns an unmodifiable cached view of attributes which can be used to identify the contact (see ContactIdentifier for further information).
      java.util.Optional<Contact> getContact()
      Get the Contact which is modified in this ContactModifier.
      java.util.Optional<java.lang.String> getExternalId()
      Get the current external id which is held in this ContactModifier.
      java.lang.String getName()
      Get the current contact name which is held in this ContactModifier.
      java.util.Optional<Tenant> getTenant()
      Get the current tenant which is held in this ContactModifier.
      ContactModifier removeAssignedAddresses​(javax.mail.internet.InternetAddress... emailAddresses)
      Remove email addresses from the associated Contact.
      ContactModifier removeAssignedPhoneNumbers​(java.lang.String... phoneNumbers)
      Remove phone numbers from the associated Contact.
      ContactModifier removeAttributes​(java.lang.String attributeName, java.lang.String... attributeValues)
      Remove attributes which can be used for identification from the associated Contact (see ContactIdentifier for further information).
      ContactModifier setExternalId​(java.lang.String externalId)
      Change the external id of the associated Contact.
      ContactModifier setName​(java.lang.String name)
      Change the name of the associated Contact.
      ContactModifier setTenant​(Tenant tenant)
      Change the tenant of the associated Contact.
      boolean validateAssignedAddresses​(javax.mail.internet.InternetAddress... emailAddresses)
      Validate the given email addresses.
      boolean validateAssignedPhoneNumbers​(java.lang.String... phoneNumbers)
      Validate the given phone numbers.
      boolean validateAttributes​(java.lang.String attributeName, java.lang.String... attributeValues)
      Validate the attributes which can be used for identification (see ContactIdentifier for further information).
      boolean validateName​(java.lang.String name)
      Validate the given name.
      boolean validateTenant​(Tenant tenant)
      Validate the given tenant.
      Contact write()
      Writes the changes done in this ContactModifier
    • Method Detail

      • getContact

        java.util.Optional<Contact> getContact()
        Get the Contact which is modified in this ContactModifier.
        Returns:
        An Optional with the contact which is modified in this ContactModifier
        Since:
        12.14
      • getName

        java.lang.String getName()
        Get the current contact name which is held in this ContactModifier.
        Returns:
        the name as String
        Since:
        12.14
      • setName

        ContactModifier setName​(java.lang.String name)
                         throws ValidationException

        Change the name of the associated Contact.

        The change is applied after the write() method is called.

        Parameters:
        name - the new name as String
        Returns:
        the ContactModifier
        Throws:
        ValidationException - if the name is null or empty
        Since:
        12.14
      • validateName

        boolean validateName​(java.lang.String name)
                      throws ValidationException
        Validate the given name.
        Parameters:
        name - the name to validate
        Returns:
        true if the name is valid
        Throws:
        ValidationException - if the name is null or empty
        Since:
        12.14
      • getAssignedAddresses

        java.util.Set<javax.mail.internet.InternetAddress> getAssignedAddresses()
        Returns an unmodifiable cached view of the assigned email addresses. The returned set is not updated when assignments change.
        Returns:
        the set of currently assigned email addresses
        Since:
        12.14
      • addAssignedAddresses

        ContactModifier addAssignedAddresses​(javax.mail.internet.InternetAddress... emailAddresses)
                                      throws ValidationException

        Add email addresses to the associated Contact.

        The change is applied after the write() method is called.

        Parameters:
        emailAddresses - the new addresses to be added - only the email address part of the InternetAddress will be used
        Returns:
        the ContactModifier
        Throws:
        ValidationException - if the new email addresses are invalid
        Since:
        12.14
      • removeAssignedAddresses

        ContactModifier removeAssignedAddresses​(javax.mail.internet.InternetAddress... emailAddresses)
                                         throws ValidationException

        Remove email addresses from the associated Contact.

        The change is applied after the write() method is called.

        Parameters:
        emailAddresses - the addresses to be removed - only the email address part of the InternetAddress will be used
        Returns:
        the ContactModifier
        Throws:
        ValidationException - if the email addresses are invalid
        Since:
        12.14
      • validateAssignedAddresses

        boolean validateAssignedAddresses​(javax.mail.internet.InternetAddress... emailAddresses)
                                   throws ValidationException
        Validate the given email addresses.
        Parameters:
        emailAddresses - the email addresses to validate
        Returns:
        true if the email addresses are valid
        Throws:
        ValidationException - if the email addresses are invalid
        Since:
        12.14
      • getAssignedPhoneNumbers

        java.util.Set<java.lang.String> getAssignedPhoneNumbers()
        Returns an unmodifiable cached view of the assigned phone numbers as Fully Qualified Telephone Numbers according to ITU-T standard E.164 (e.g. +49401234567). The returned set is not updated when assignments change.
        Returns:
        the set of currently assigned phone numbers
        Since:
        12.14
      • addAssignedPhoneNumbers

        ContactModifier addAssignedPhoneNumbers​(java.lang.String... phoneNumbers)
                                         throws ValidationException

        Add phone numbers to the associated Contact.

        The change is applied after the write() method is called.

        Parameters:
        phoneNumbers - the new phone numbers to be added
        Returns:
        the ContactModifier
        Throws:
        ValidationException - if the new phone numbers are not Fully Qualified Telephone Numbers according to ITU-T standard E.164 (e.g. +49401234567).
        Since:
        12.14
      • removeAssignedPhoneNumbers

        ContactModifier removeAssignedPhoneNumbers​(java.lang.String... phoneNumbers)
                                            throws ValidationException

        Remove phone numbers from the associated Contact.

        The change is applied after the write() method is called.

        Parameters:
        phoneNumbers - the phone numbers to be removed
        Returns:
        the ContactModifier
        Throws:
        ValidationException - if the phone numbers are not Fully Qualified Telephone Numbers according to ITU-T standard E.164 (e.g. +49401234567).
        Since:
        12.14
      • validateAssignedPhoneNumbers

        boolean validateAssignedPhoneNumbers​(java.lang.String... phoneNumbers)
                                      throws ValidationException
        Validate the given phone numbers.
        Parameters:
        phoneNumbers - the phone numbers to validate
        Returns:
        true if the phone numbers are valid
        Throws:
        ValidationException - if the phone numbers are not Fully Qualified Telephone Numbers according to ITU-T standard E.164 (e.g. +49401234567).
        Since:
        12.14
      • getAttributes

        java.util.Map<java.lang.String,​java.util.Set<java.lang.String>> getAttributes()
        Returns an unmodifiable cached view of attributes which can be used to identify the contact (see ContactIdentifier for further information). The key is the name of the attribute which maps to the associated attribute values. An example of a contact attribute would be an id which identifies the contact in an external service. The returned map is not updated when the contact attributes change.
        Returns:
        the map of attributes which can be used to identify the contact
        Since:
        12.14
      • addAttributes

        ContactModifier addAttributes​(java.lang.String attributeName,
                                      java.lang.String... attributeValues)
                               throws ValidationException

        Add attributes which can be used for identification to the associated Contact (see ContactIdentifier for further information).

        The change is applied after the write() method is called.

        Parameters:
        attributeName - the name of the attributes to be added
        attributeValues - the values of the attributes to be added
        Returns:
        the ContactModifier
        Throws:
        ValidationException - if the attribute name or values are invalid
        Since:
        12.14
      • removeAttributes

        ContactModifier removeAttributes​(java.lang.String attributeName,
                                         java.lang.String... attributeValues)
                                  throws ValidationException

        Remove attributes which can be used for identification from the associated Contact (see ContactIdentifier for further information).

        The change is applied after the write() method is called.

        Parameters:
        attributeName - the name of the attributes to be removed
        attributeValues - the values of the attributes to be removed
        Returns:
        the ContactModifier
        Throws:
        ValidationException - if the attribute name or values are invalid
        Since:
        12.14
      • validateAttributes

        boolean validateAttributes​(java.lang.String attributeName,
                                   java.lang.String... attributeValues)
                            throws ValidationException
        Validate the attributes which can be used for identification (see ContactIdentifier for further information).
        Parameters:
        attributeName - the name of the attributes to validate
        attributeValues - the values of the attributes to validate
        Returns:
        true if the attributes are valid
        Throws:
        ValidationException - if the attribute name or values are invalid
        Since:
        12.14
      • getExternalId

        java.util.Optional<java.lang.String> getExternalId()
        Get the current external id which is held in this ContactModifier.
        Returns:
        the external id as String
        Since:
        12.14
      • setExternalId

        ContactModifier setExternalId​(java.lang.String externalId)

        Change the external id of the associated Contact.

        The change is applied after the write() method is called.

        Parameters:
        externalId - the new external id as String
        Returns:
        the ContactModifier
        Since:
        12.14
      • getTenant

        java.util.Optional<Tenant> getTenant()
        Get the current tenant which is held in this ContactModifier.
        Returns:
        the current tenant
        Since:
        12.14
      • validateTenant

        boolean validateTenant​(Tenant tenant)
                        throws ValidationException
        Validate the given tenant.
        Parameters:
        tenant - the tenant to validate
        Returns:
        true if the tenant is valid
        Throws:
        ValidationException - if the tenant is invalid
        Since:
        12.14