本文整理汇总了Java中ezvcard.property.Email类的典型用法代码示例。如果您正苦于以下问题:Java Email类的具体用法?Java Email怎么用?Java Email使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Email类属于ezvcard.property包,在下文中一共展示了Email类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getEmail
import ezvcard.property.Email; //导入依赖的package包/类
private EmailDTO getEmail(Email email) {
EmailDTO emailDTO = new EmailDTO();
if (email != null) {
emailDTO.setAddress(email.getValue());
// emailDTO.setAddress(email.getValue());
// TODO: Add multi-type support
StringBuilder sb = new StringBuilder();
Set<EmailType> types = SetUtil.fromList(email.getTypes());
if (types.size() > 0) {
for (EmailType type : types) {
sb.append(type.getValue());
}
} else {
sb.append("other");
}
emailDTO.setType(sb.toString());
}
return emailDTO;
}
开发者ID:inofix,项目名称:ch-inofix-contact-manager,代码行数:26,代码来源:ContactImpl.java
示例2: convertEmails
import ezvcard.property.Email; //导入依赖的package包/类
private void convertEmails(List<NonEmptyContentValues> contentValues, VCard vcard) {
for (Email email : vcard.getEmails()) {
String value = email.getValue();
if (isEmpty(value)) {
continue;
}
int emailKind = DataMappings.getEmailType(email);
NonEmptyContentValues cv = new NonEmptyContentValues(ContactsContract.CommonDataKinds.Email.CONTENT_ITEM_TYPE);
cv.put(ContactsContract.CommonDataKinds.Email.ADDRESS, value);
cv.put(ContactsContract.CommonDataKinds.Email.TYPE, emailKind);
contentValues.add(cv);
}
}
开发者ID:mangstadt,项目名称:ez-vcard-android,代码行数:16,代码来源:ContactOperations.java
示例3: getEmailType
import ezvcard.property.Email; //导入依赖的package包/类
/**
* Determines the appropriate Android
* {@link ContactsContract.CommonDataKinds.Email} value for an {@link Email}
* property.
* @param property the property
* @return the Android type value
*/
public static int getEmailType(Email property) {
for (EmailType type : property.getTypes()){
Integer androidType = emailTypeMappings.get(type);
if (androidType != null){
return androidType;
}
}
return ContactsContract.CommonDataKinds.Email.TYPE_OTHER;
}
开发者ID:mangstadt,项目名称:ez-vcard-android,代码行数:17,代码来源:DataMappings.java
示例4: getEmail1Address
import ezvcard.property.Email; //导入依赖的package包/类
public String getEmail1Address() {
Iterator<Email> iter = (Iterator<Email>) this.vcard.getEmails().iterator();
while (iter.hasNext()) {
Email currentEmail = iter.next();
if (currentEmail.getTypes().contains(EmailType.HOME)) {
if (currentEmail.getValue().length() > 0) {
return currentEmail.getValue();
}
}
}
return null;
}
开发者ID:somedevelopment,项目名称:CardDAVSyncOutlook,代码行数:15,代码来源:Contact.java
示例5: getEmail2Address
import ezvcard.property.Email; //导入依赖的package包/类
public String getEmail2Address() {
Iterator<Email> iter = (Iterator<Email>) this.vcard.getEmails().iterator();
while (iter.hasNext()) {
Email currentEmail = iter.next();
if (currentEmail.getTypes().contains(EmailType.WORK)) {
if (currentEmail.getValue().length() > 0) {
return currentEmail.getValue();
}
}
}
return null;
}
开发者ID:somedevelopment,项目名称:CardDAVSyncOutlook,代码行数:15,代码来源:Contact.java
示例6: getEmail3Address
import ezvcard.property.Email; //导入依赖的package包/类
public String getEmail3Address() {
Iterator<Email> iter = (Iterator<Email>) this.vcard.getEmails().iterator();
while (iter.hasNext()) {
Email currentEmail = iter.next();
if (currentEmail.getTypes().contains(EmailType.INTERNET)) {
if (currentEmail.getValue().length() > 0) {
return currentEmail.getValue();
}
}
}
return null;
}
开发者ID:somedevelopment,项目名称:CardDAVSyncOutlook,代码行数:15,代码来源:Contact.java
示例7: getEmails
import ezvcard.property.Email; //导入依赖的package包/类
/**
*
* @return
* @since 1.0.0
*/
@Override
public List<EmailDTO> getEmails() {
List<EmailDTO> emailDTOs = new ArrayList<EmailDTO>();
List<Email> emails = getVCard().getEmails();
for (Email email : emails) {
EmailDTO emailDTO = getEmail(email);
emailDTOs.add(emailDTO);
}
// an empty default email
if (emailDTOs.size() == 0) {
emailDTOs.add(new EmailDTO());
}
return emailDTOs;
}
开发者ID:inofix,项目名称:ch-inofix-contact-manager,代码行数:28,代码来源:ContactImpl.java
注:本文中的ezvcard.property.Email类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论