public Address( final String mailAddress, final String personal ) throws IllegalArgumentException { this.mailAddress = mailAddress; this.personal = personal; validateAddress( this ); }
/** * Performs a formal validation of an e-mail address. * * @param address string representing an e-mail address. * @throws IllegalArgumentException */ public static void validateAddress( final String address ) throws IllegalArgumentException { if ( Strings.isEmpty( address ) ) { throw new IllegalArgumentException( "E-mail address cannot be empty!" ); } validateAddress( new Address( address ) ); }