19 package org.turro.mail.provider;
21 import org.turro.plugin.contacts.IContact;
22 import org.turro.string.Strings;
30 private String name, mail;
31 private String friendly, formal;
52 return Strings.isBlank(mail);
57 public String
parse(String text) {
58 if(!Strings.isBlank(mail)) {
59 text = text.replaceAll(
"\\{email\\}", mail);
61 if(!Strings.isBlank(name)) {
62 text = text.replaceAll(
"\\{name\\}", name);
64 if(!Strings.isBlank(friendly)) {
65 text = text.replaceAll(
"\\{friendly\\}", friendly);
67 if(!Strings.isBlank(formal)) {
68 text = text.replaceAll(
"\\{formal\\}", formal);
77 if(value.contains(
"|")) {
78 String[] parts = value.split(
"\\|");
87 recipient.mail = mail;
88 recipient.name = name;
89 recipient.formal = name;
90 recipient.friendly = name;
97 recipient.name = contact.
getName();
static MailRecipient of(String value)
void setName(String name)
void setMail(String mail)
String parse(String text)
static MailRecipient of(String mail, String name)
static MailRecipient of(IContact contact)