Class DefaultExternalIdentifierComparator


  • public class DefaultExternalIdentifierComparator
    extends Object
    Default comparator for external identifiers (Xref database and id). It is not a java comparator because the order can change. It compares first the databases and then the ids (case sensitive) but ignores the version. To compare the databases, it looks first at the PSI-MI id if they exist, otherwise it looks at the database shortlabel only. - Two external identifiers which are null are equals - If the two external identifiers are set : - Compare the databases. If both databases are equal, compare the ids (is case sensitive)
    Since:
    18/12/12
    Version:
    $Id$
    Author:
    Marine Dumousseau (marine@ebi.ac.uk)
    • Constructor Detail

      • DefaultExternalIdentifierComparator

        public DefaultExternalIdentifierComparator()
    • Method Detail

      • areEquals

        public static boolean areEquals​(Xref externalIdentifier1,
                                        Xref externalIdentifier2)
        Use DefaultIdentifierComparator to know if two external identifiers are equals.
        Parameters:
        externalIdentifier1 - a Xref object.
        externalIdentifier2 - a Xref object.
        Returns:
        true if the two external identifiers are equal