public void setAddress ( final String address ) { // Do we have a subaddressing account? Preconditions . checkArgument ( StringUtils . startsWith ( this . address , accountId + "+" ) , "Mail address can only be changed when subaddressing is active" ) ; Preconditions . checkArgument ( StringUtils . startsWith ( address , accountId ) , "New mail address %s does not start with accountId=%s" , address , accountId ) ; log . info ( "Changing mail address from {} to {}" , this . address , address ) ; this . address = address ; }
Allows to set a new mail address . This is only possible when mail subaddressing is active and the new mail address belongs to the defined mail accountId .