73
73
public static CacheIdentifier factory( Importer.ContactData contact )
75
CacheIdentifier ret = null;
75
CacheIdentifier identifier = null;
77
77
if( contact.hasName() )
78
ret = factory( CacheIdentifier.Type.NAME,
78
identifier = factory( CacheIdentifier.Type.NAME,
79
79
contact.getName() );
80
if( ret == null && contact.hasPrimaryOrganisation() )
81
ret = factory( CacheIdentifier.Type.ORGANISATION,
80
if( identifier != null ) return identifier;
82
if( contact.hasPrimaryOrganisation() )
83
identifier = factory( CacheIdentifier.Type.ORGANISATION,
82
84
contact.getPrimaryOrganisation() );
83
if( ret == null && contact.hasPrimaryNumber() )
84
ret = factory( CacheIdentifier.Type.PRIMARY_NUMBER,
85
if( identifier != null ) return identifier;
87
if( contact.hasPrimaryNumber() )
88
identifier = factory( CacheIdentifier.Type.PRIMARY_NUMBER,
85
89
contact.getPrimaryNumber() );
86
if( ret == null && contact.hasPrimaryEmail() )
87
ret = factory( CacheIdentifier.Type.PRIMARY_EMAIL,
90
if( identifier != null ) return identifier;
92
if( contact.hasPrimaryEmail() )
93
identifier = factory( CacheIdentifier.Type.PRIMARY_EMAIL,
88
94
contact.getPrimaryEmail() );
95
if( identifier != null ) return identifier;
93
100
protected CacheIdentifier( Type type, String detail )