001package org.gbif.dwc.terms;
002
003import java.util.Comparator;
004
005/**
006 * Compares terms by their qualified name.
007 * Java enums (term classes) have a final natural order implemented which cannot be changed.
008 */
009public class TermComparator implements Comparator<Term> {
010
011  @Override
012  public int compare(Term o1, Term o2) {
013    return o1.qualifiedName().compareTo(o2.qualifiedName());
014  }
015}