Class AttributeSchemaComparator

  • All Implemented Interfaces:
    Comparator

    public class AttributeSchemaComparator
    extends Object
    implements Comparator
    This comparator compares the i18n key of two AttributeSchema objects. Its supports Collator.
    • Constructor Detail

      • AttributeSchemaComparator

        public AttributeSchemaComparator​(Collator collator)
        Constructs of an attribute schema's i18n key comparator object
        Parameters:
        collator - for locale base sorting
    • Method Detail

      • compare

        public int compare​(Object o1,
                           Object o2)
        Performs string comparison on attribute schema's i18n keys
        Specified by:
        compare in interface Comparator
        Parameters:
        o1 - AttributeSchema object
        o2 - AttributeSchema object
        Returns:
        0 if i18n key of o1 is equal to i18n key of o2; less than 0 if i18n key of o1 is lexicographically less than i18n key of o2; greater than 0 if i18n key of o1 is greater than i18n key of o2.