Class ContactUtils

java.lang.Object
ubic.gemma.model.common.auditAndSecurity.ContactUtils

public final class ContactUtils extends Object
Helpers for reading a Contact the way a person is displayed.
Author:
paul
  • Method Details

    • displayName

      @Nullable public static String displayName(@Nullable Contact contact)
      The best available human-readable name for a contact: its name, else the account's userName.

      A Gemma User carries userName separately from the name it inherits as a Person, and the contact name is optional. Anything typed ContactTicket's reporter and assignee, a TicketEvent's actor — therefore reads null for an account that never filled one in, even though the account has a username. AuditEventValueObject does not hit this because AuditEvent.performer is declared User.

      Parameters:
      contact - a contact, possibly an uninitialized-but-attached proxy; may be null
      Returns:
      the name, else the username, else null — never blank