コード例 #1
0
 /**
  * Get the person.
  *
  * @param type the type.
  * @param accountId account id.
  * @param entities the person.
  * @return the person.
  */
 private String getEntityDisplayName(
     final EntityType type,
     final String accountId, //
     final List<Serializable> entities) {
   for (Serializable entity : entities) {
     if (type.equals(EntityType.PERSON)
         && entity instanceof PersonModelView
         && ((PersonModelView) entity).getUniqueId().equals(accountId)) {
       return ((PersonModelView) entity).getDisplayName();
     }
     if (type.equals(EntityType.GROUP)
         && entity instanceof DomainGroupModelView
         && ((DomainGroupModelView) entity).getUniqueId().equals(accountId)) {
       return ((DomainGroupModelView) entity).getName();
     }
   }
   return null;
 }