Enum BasicComparator.StringComparisonMethod

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<BasicComparator.StringComparisonMethod>
    Enclosing class:
    BasicComparator<T extends Storable>

    public static enum BasicComparator.StringComparisonMethod
    extends java.lang.Enum<BasicComparator.StringComparisonMethod>
    Possible implementation of String comparison.

    Default value can be specified using property comparator-string.comparison-method.
    For example

    comparator-string.comparison-method: UnaccentuateStringIgnoreCase

    Or per Comparator class using property comparator-string.comparison-method.{comparator-classname}.
    For example
    comparator-string.comparison-method.com.jalios.jcms.Member$NameComparator: IcuCollationKey
    Since:
    jcms-10.0.4 / JCMS-8000
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      CollationKey
      Uses CollationKey.compareTo(CollationKey) (instanciated and cached for each value, with current locale).
      Collator
      Uses Collator.compare(String, String) (with current locale)
      IcuCollationKey
      Uses ICU4J CollationKey.compareTo(com.ibm.icu.text.CollationKey) (instanciated and cached for each value, with current locale).
      IcuCollator
      Uses ICU4J Collator.compare(String, String) (with current locale).
      StringIgnoreCase
      Uses String.compareToIgnoreCase(String)
      UnaccentuateStringIgnoreCase
      Uses Util.unaccentuate(String) and String.compareToIgnoreCase(String)
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static BasicComparator.StringComparisonMethod valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static BasicComparator.StringComparisonMethod[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • CollationKey

        public static final BasicComparator.StringComparisonMethod CollationKey
        Uses CollationKey.compareTo(CollationKey) (instanciated and cached for each value, with current locale).
      • IcuCollator

        public static final BasicComparator.StringComparisonMethod IcuCollator
        Uses ICU4J Collator.compare(String, String) (with current locale).

        This comparison method supports an additional configuration to specify the ICU4j collation keyword to be used in the corresponding ICU4J Locale.
        Default value can be specified using property comparator-string.icu-collator.collation.
        For example

        comparator-string.icu-collator.collation: phonebook

        Or per Comparator class using property comparator-string.icu-collator.collation.{comparator-classname}.
        For example
        comparator-string.icu-collator.collation.com.jalios.jcms.Member$NameComparator: phonebook
      • IcuCollationKey

        public static final BasicComparator.StringComparisonMethod IcuCollationKey
        Uses ICU4J CollationKey.compareTo(com.ibm.icu.text.CollationKey) (instanciated and cached for each value, with current locale).

        Supports same configuration as IcuCollator.

    • Method Detail

      • values

        public static BasicComparator.StringComparisonMethod[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (BasicComparator.StringComparisonMethod c : BasicComparator.StringComparisonMethod.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static BasicComparator.StringComparisonMethod valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null