本文整理汇总了Java中ezvcard.property.Telephone类的典型用法代码示例。如果您正苦于以下问题:Java Telephone类的具体用法?Java Telephone怎么用?Java Telephone使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Telephone类属于ezvcard.property包,在下文中一共展示了Telephone类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getPhone
import ezvcard.property.Telephone; //导入依赖的package包/类
private PhoneDTO getPhone(Telephone phone) {
PhoneDTO phoneDTO = new PhoneDTO();
if (phone != null) {
phoneDTO.setNumber(phone.getText());
StringBuilder sb = new StringBuilder();
Set<TelephoneType> types = SetUtil.fromList(phone.getTypes());
// TODO: Add support for multiple telephone types
// e.g. home-fax, work-mobile, etc.
if (types.size() > 0) {
for (TelephoneType type : types) {
sb.append(type.getValue());
}
} else {
sb.append("other");
}
phoneDTO.setType(sb.toString());
}
return phoneDTO;
}
开发者ID:inofix,项目名称:ch-inofix-contact-manager,代码行数:27,代码来源:ContactImpl.java
示例2: convertPhones
import ezvcard.property.Telephone; //导入依赖的package包/类
private void convertPhones(List<NonEmptyContentValues> contentValues, VCard vcard) {
for (Telephone telephone : vcard.getTelephoneNumbers()) {
String value = telephone.getText();
TelUri uri = telephone.getUri();
if (isEmpty(value)) {
if (uri == null) {
continue;
}
value = uri.toString();
}
int phoneKind = DataMappings.getPhoneType(telephone);
NonEmptyContentValues cv = new NonEmptyContentValues(ContactsContract.CommonDataKinds.Phone.CONTENT_ITEM_TYPE);
cv.put(ContactsContract.CommonDataKinds.Phone.NUMBER, value);
cv.put(ContactsContract.CommonDataKinds.Phone.TYPE, phoneKind);
contentValues.add(cv);
}
}
开发者ID:mangstadt,项目名称:ez-vcard-android,代码行数:20,代码来源:ContactOperations.java
示例3: getPhoneType
import ezvcard.property.Telephone; //导入依赖的package包/类
/**
* Determines the appropriate Android
* {@link ContactsContract.CommonDataKinds.Phone} value for a
* {@link Telephone} property.
* @param property the property
* @return the Android type value
*/
public static int getPhoneType(Telephone property) {
for (TelephoneType type : property.getTypes()){
Integer androidType = phoneTypeMappings.get(type);
if (androidType != null){
return androidType;
}
}
return ContactsContract.CommonDataKinds.Phone.TYPE_OTHER;
}
开发者ID:mangstadt,项目名称:ez-vcard-android,代码行数:17,代码来源:DataMappings.java
示例4: getMobileTelephoneNumber
import ezvcard.property.Telephone; //导入依赖的package包/类
public String getMobileTelephoneNumber() {
Iterator<Telephone> iter = (Iterator<Telephone>) this.vcard.getTelephoneNumbers().iterator();
while (iter.hasNext()) {
Telephone currentPhone = iter.next();
if (currentPhone.getTypes().contains(TelephoneType.CELL)) {
if (currentPhone.getText().length() > 0) {
return currentPhone.getText();
}
}
}
return null;
}
开发者ID:somedevelopment,项目名称:CardDAVSyncOutlook,代码行数:15,代码来源:Contact.java
示例5: getBusinessTelephoneNumber
import ezvcard.property.Telephone; //导入依赖的package包/类
public String getBusinessTelephoneNumber() {
Iterator<Telephone> iter = (Iterator<Telephone>) this.vcard.getTelephoneNumbers().iterator();
while (iter.hasNext()) {
Telephone currentPhone = iter.next();
if (currentPhone.getTypes().contains(TelephoneType.WORK)) {
if (currentPhone.getText().length() > 0) {
return currentPhone.getText();
}
}
}
return null;
}
开发者ID:somedevelopment,项目名称:CardDAVSyncOutlook,代码行数:15,代码来源:Contact.java
示例6: getBusiness2TelephoneNumber
import ezvcard.property.Telephone; //导入依赖的package包/类
public String getBusiness2TelephoneNumber() {
Iterator<Telephone> iter = (Iterator<Telephone>) this.vcard.getTelephoneNumbers().iterator();
while (iter.hasNext()) {
Telephone currentPhone = iter.next();
if (currentPhone.getTypes().contains(TelephoneType.CAR)) {
if (currentPhone.getText().length() > 0) {
return currentPhone.getText();
}
}
}
return null;
}
开发者ID:somedevelopment,项目名称:CardDAVSyncOutlook,代码行数:15,代码来源:Contact.java
示例7: getBusinessFaxNumber
import ezvcard.property.Telephone; //导入依赖的package包/类
public String getBusinessFaxNumber() {
Iterator<Telephone> iter = (Iterator<Telephone>) this.vcard.getTelephoneNumbers().iterator();
while (iter.hasNext()) {
Telephone currentPhone = iter.next();
if (currentPhone.getTypes().contains(TelephoneType.FAX)) {
if (currentPhone.getText().length() > 0) {
return currentPhone.getText();
}
}
}
return null;
}
开发者ID:somedevelopment,项目名称:CardDAVSyncOutlook,代码行数:15,代码来源:Contact.java
示例8: getHomeTelephoneNumber
import ezvcard.property.Telephone; //导入依赖的package包/类
public String getHomeTelephoneNumber() {
Iterator<Telephone> iter = (Iterator<Telephone>) this.vcard.getTelephoneNumbers().iterator();
while (iter.hasNext()) {
Telephone currentPhone = iter.next();
if (currentPhone.getTypes().contains(TelephoneType.HOME)) {
if (currentPhone.getText().length() > 0) {
return currentPhone.getText();
}
}
}
return null;
}
开发者ID:somedevelopment,项目名称:CardDAVSyncOutlook,代码行数:15,代码来源:Contact.java
示例9: getHome2TelephoneNumber
import ezvcard.property.Telephone; //导入依赖的package包/类
public String getHome2TelephoneNumber() {
Iterator<Telephone> iter = (Iterator<Telephone>) this.vcard.getTelephoneNumbers().iterator();
while (iter.hasNext()) {
Telephone currentPhone = iter.next();
if (currentPhone.getTypes().contains(TelephoneType.ISDN)) {
if (currentPhone.getText().length() > 0) {
return currentPhone.getText();
}
}
}
return null;
}
开发者ID:somedevelopment,项目名称:CardDAVSyncOutlook,代码行数:15,代码来源:Contact.java
示例10: getHomeFaxNumber
import ezvcard.property.Telephone; //导入依赖的package包/类
public String getHomeFaxNumber() {
Iterator<Telephone> iter = (Iterator<Telephone>) this.vcard.getTelephoneNumbers().iterator();
while (iter.hasNext()) {
Telephone currentPhone = iter.next();
if (currentPhone.getTypes().contains(TelephoneType.MSG)) {
if (currentPhone.getText().length() > 0) {
return currentPhone.getText();
}
}
}
return null;
}
开发者ID:somedevelopment,项目名称:CardDAVSyncOutlook,代码行数:15,代码来源:Contact.java
示例11: getAssistantTelephoneNumber
import ezvcard.property.Telephone; //导入依赖的package包/类
public String getAssistantTelephoneNumber() {
Iterator<Telephone> iter = (Iterator<Telephone>) this.vcard.getTelephoneNumbers().iterator();
while (iter.hasNext()) {
Telephone currentPhone = iter.next();
if (currentPhone.getTypes().contains(TelephoneType.BBS)) {
if (currentPhone.getText().length() > 0) {
return currentPhone.getText();
}
}
}
return null;
}
开发者ID:somedevelopment,项目名称:CardDAVSyncOutlook,代码行数:15,代码来源:Contact.java
示例12: getCallbackTelephoneNumber
import ezvcard.property.Telephone; //导入依赖的package包/类
public String getCallbackTelephoneNumber() {
Iterator<Telephone> iter = (Iterator<Telephone>) this.vcard.getTelephoneNumbers().iterator();
while (iter.hasNext()) {
Telephone currentPhone = iter.next();
if (currentPhone.getTypes().contains(TelephoneType.MODEM)) {
if (currentPhone.getText().length() > 0) {
return currentPhone.getText();
}
}
}
return null;
}
开发者ID:somedevelopment,项目名称:CardDAVSyncOutlook,代码行数:15,代码来源:Contact.java
示例13: getCarTelephoneNumber
import ezvcard.property.Telephone; //导入依赖的package包/类
public String getCarTelephoneNumber() {
Iterator<Telephone> iter = (Iterator<Telephone>) this.vcard.getTelephoneNumbers().iterator();
while (iter.hasNext()) {
Telephone currentPhone = iter.next();
if (currentPhone.getTypes().contains(TelephoneType.PAGER)) {
if (currentPhone.getText().length() > 0) {
return currentPhone.getText();
}
}
}
return null;
}
开发者ID:somedevelopment,项目名称:CardDAVSyncOutlook,代码行数:15,代码来源:Contact.java
示例14: getCompanyMainTelephoneNumber
import ezvcard.property.Telephone; //导入依赖的package包/类
public String getCompanyMainTelephoneNumber() {
Iterator<Telephone> iter = (Iterator<Telephone>) this.vcard.getTelephoneNumbers().iterator();
while (iter.hasNext()) {
Telephone currentPhone = iter.next();
if (currentPhone.getTypes().contains(TelephoneType.PCS)) {
if (currentPhone.getText().length() > 0) {
return currentPhone.getText();
}
}
}
return null;
}
开发者ID:somedevelopment,项目名称:CardDAVSyncOutlook,代码行数:15,代码来源:Contact.java
示例15: getOtherTelephoneNumber
import ezvcard.property.Telephone; //导入依赖的package包/类
public String getOtherTelephoneNumber() {
Iterator<Telephone> iter = (Iterator<Telephone>) this.vcard.getTelephoneNumbers().iterator();
while (iter.hasNext()) {
Telephone currentPhone = iter.next();
if (currentPhone.getTypes().contains(TelephoneType.PREF)) {
if (currentPhone.getText().length() > 0) {
return currentPhone.getText();
}
}
}
return null;
}
开发者ID:somedevelopment,项目名称:CardDAVSyncOutlook,代码行数:15,代码来源:Contact.java
示例16: getPrimaryTelephoneNumber
import ezvcard.property.Telephone; //导入依赖的package包/类
public String getPrimaryTelephoneNumber() {
Iterator<Telephone> iter = (Iterator<Telephone>) this.vcard.getTelephoneNumbers().iterator();
while (iter.hasNext()) {
Telephone currentPhone = iter.next();
if (currentPhone.getTypes().contains(TelephoneType.VIDEO)) {
if (currentPhone.getText().length() > 0) {
return currentPhone.getText();
}
}
}
return null;
}
开发者ID:somedevelopment,项目名称:CardDAVSyncOutlook,代码行数:15,代码来源:Contact.java
示例17: getRadioTelephoneNumber
import ezvcard.property.Telephone; //导入依赖的package包/类
public String getRadioTelephoneNumber() {
Iterator<Telephone> iter = (Iterator<Telephone>) this.vcard.getTelephoneNumbers().iterator();
while (iter.hasNext()) {
Telephone currentPhone = iter.next();
if (currentPhone.getTypes().contains(TelephoneType.VOICE)) {
if (currentPhone.getText().length() > 0) {
return currentPhone.getText();
}
}
}
return null;
}
开发者ID:somedevelopment,项目名称:CardDAVSyncOutlook,代码行数:15,代码来源:Contact.java
示例18: getTTYTDDTelephoneNumber
import ezvcard.property.Telephone; //导入依赖的package包/类
public String getTTYTDDTelephoneNumber() {
Iterator<Telephone> iter = (Iterator<Telephone>) this.vcard.getTelephoneNumbers().iterator();
while (iter.hasNext()) {
Telephone currentPhone = iter.next();
if (currentPhone.getTypes().contains(TelephoneType.TEXT)) {
if (currentPhone.getText().length() > 0) {
return currentPhone.getText();
}
}
}
return null;
}
开发者ID:somedevelopment,项目名称:CardDAVSyncOutlook,代码行数:15,代码来源:Contact.java
示例19: getPhones
import ezvcard.property.Telephone; //导入依赖的package包/类
/**
*
* @return
* @since 1.0.0
*/
@Override
public List<PhoneDTO> getPhones() {
List<PhoneDTO> phoneDTOs = new ArrayList<PhoneDTO>();
List<Telephone> phones = getVCard().getTelephoneNumbers();
for (Telephone phone : phones) {
PhoneDTO phoneDTO = getPhone(phone);
phoneDTOs.add(phoneDTO);
}
// an empty default phone
if (phoneDTOs.size() == 0) {
phoneDTOs.add(new PhoneDTO());
}
return phoneDTOs;
}
开发者ID:inofix,项目名称:ch-inofix-contact-manager,代码行数:28,代码来源:ContactImpl.java
示例20: visit
import ezvcard.property.Telephone; //导入依赖的package包/类
@Override
public void visit(VmgObj e) {
//if the (list of) contacts doesn't exists in any conversation, create a new conversation
Conversation foundConversation = null;
for (Conversation conv : conversations) {
if(conv.isContainingContactCollection(e.getvOriginator())) {
foundConversation = conv;
break;
}
}
if(foundConversation == null) {
//We didn't find any conversation containing contacts from the vcard, so create a new one.
Conversation newConv = new Conversation();
newConv.contacts.addAll(e.getvOriginator());
for(VCard c : newConv.contacts)
{
FormattedName vEZName = c.getFormattedName();
//Check if we have a name. If not, use the phone number as contact name.
if(vEZName == null)
{
List<Telephone> vTel = c.getTelephoneNumbers();
if(vTel == null)
{
//We have no phone number either.
contactNames.add("<<UNKNOWN>>");
continue;
}
//Take the first number as the contact name.
for(Telephone t : vTel)
{
String vName = t.getText();
if(vName != null)
{
System.out.println("New conversation with: " + vName);
contactNames.add(vName);
}
}
}
else
{
//We have a name: add it directly to the conversation.
contactNames.add(vEZName.getValue());
}
}
//Add the message to the conversation
newConv.messages.add(e);
//Add the conversation to the list of all conversation
conversations.add(newConv);
System.out.println("New conversation added");
} else {
foundConversation.messages.add(e);
System.out.println("Added to current conversation");
}
}
开发者ID:louisbob,项目名称:tovmgr,代码行数:64,代码来源:Visitor_UpdateContactView.java
注:本文中的ezvcard.property.Telephone类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论