Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Creative commons Attribution-NonCommercial license. http://creativecommons.org/licenses/by-nc/2.5/au/deed.en_GB NO WARRANTY IS GIVEN OR IMPLIED, USE AT YOUR OWN RISK.
 
 package base.email;

Encapsulates an email address, optionally includes a name for the person owning the email address.
public class EmailAddress {
	private String name;
	private String address;
	public EmailAddress() {
		 = "";
		 = "";
	}
	public EmailAddress(String nameString address) {
		this. = name;
		this. = address;
	}
	public EmailAddress(String address) {
		this. = "";
		this. = address;
	}
	public String getName() {
		return ;
	}
	public String getAddress() {
		return ;
	}
	public void setName(String name) {
		if(name == null) {
			this. = "";
else {
			this. = name;
		}
	}
	public void setAddress(String address) {
		if(address == null) {
			this. = "";
else {
			this. = address;
		}
	}
	public String toString() {
		if( == "") {
			return ;
		}
		return "\"" +  + "\" <" +  + ">";
	}
New to GrepCode? Check out our FAQ X