@ -70,7 +70,7 @@ public class Contact extends Resource {
@Getter @Setter private String displayName , nickName ;
@Getter @Setter private String prefix , givenName , middleName , familyName , suffix ;
@Getter @Setter private String phoneticGivenName , phoneticMiddleName , phoneticFamilyName ;
@Getter @Setter private String note , URL ;
@Getter @Setter private String note ;
@Getter @Setter private String organization , role ;
@Getter @Setter private byte [ ] photo ;
@ -78,10 +78,11 @@ public class Contact extends Resource {
@Getter @Setter private Anniversary anniversary ;
@Getter @Setter private Birthday birthDay ;
@Getter private List < Email > emails = new LinkedList < Email > ( ) ;
@Getter private List < Telephone > phoneNumbers = new LinkedList < Telephone > ( ) ;
@Getter private List < Address> addresses = new LinkedList < Address > ( ) ;
@Getter private List < Email> emails = new LinkedList < Email > ( ) ;
@Getter private List < Impp > impps = new LinkedList < Impp > ( ) ;
@Getter private List < Address > addresses = new LinkedList < Address > ( ) ;
@Getter private List < String > URLs = new LinkedList < String > ( ) ;
/* instance methods */
@ -174,10 +175,8 @@ public class Contact extends Resource {
addresses = vcard . getAddresses ( ) ;
for ( Url url : vcard . getUrls ( ) ) {
URL = url . getValue ( ) ;
break ;
}
for ( Url url : vcard . getUrls ( ) )
URLs . add ( url . getValue ( ) ) ;
birthDay = vcard . getBirthday ( ) ;
anniversary = vcard . getAnniversary ( ) ;
@ -187,6 +186,7 @@ public class Contact extends Resource {
@Override
public String toEntity ( ) throws IOException {
VCard vcard = new VCard ( ) ;
vcard . setProdId ( "DAVdroid/" + Constants . APP_VERSION + " (ez-vcard/" + Ezvcard . VERSION + ")" ) ;
if ( uid ! = null )
vcard . setUid ( new Uid ( uid ) ) ;
@ -249,19 +249,19 @@ public class Contact extends Resource {
for ( Address address : addresses )
vcard . addAddress ( address ) ;
if ( URL ! = null & & ! URL . isEmpty ( ) )
vcard . addUrl ( URL ) ;
for ( String url : URLs )
vcard . addUrl ( url ) ;
if ( anniversary ! = null )
vcard . setAnniversary ( anniversary ) ;
if ( birthDay ! = null )
vcard . setBirthday ( birthDay ) ;
vcard . setProdId ( "DAVdroid/" + Constants . APP_VERSION ) ;
vcard . setRevision ( Revision . now ( ) ) ;
return Ezvcard
. write ( vcard )
. version ( VCardVersion . V3_0 )
. prodId ( false ) // we provide or own PRODID
. go ( ) ;
}
}