serviceList = new ServiceObject[ serviceRecords.length ];
for( int i = 0; i < serviceRecords.length; i++ ) {
final ServiceRecord serviceRecord = serviceRecords[ i ];
String emailAddress = null;
if( type == ServiceObject.TYPE_EMAIL ) {
final ServiceConfiguration serviceConfig = new ServiceConfiguration( serviceRecord );
emailAddress = serviceConfig.getEmailAddress();
}
serviceList[ i ] = new ServiceObject( emailAddress, serviceRecord.getName(), new Integer( type ), serviceRecord
.getUid(), serviceRecord.getCid() );
}
return serviceList;
}