Class CollationResolver

java.lang.Object
org.rumbledb.runtime.functions.strings.CollationResolver

public final class CollationResolver extends Object
Resolves a collation URI to a Comparator usable for string comparison, backed by ICU4J for the UCA-parametrized collation family.
  • Method Details

    • resolve

      public static Comparator<String> resolve(String collationUri, ExceptionMetadata metadata)
    • equals

      public static boolean equals(String a, String b, String collationUri, ExceptionMetadata metadata)
    • collationKeyBytes

      public static byte[] collationKeyBytes(String value, String collationUri, ExceptionMetadata metadata)
      Returns a byte encoding such that unsigned lexicographic order of the bytes matches the collation order (used by fn:collation-key). For the codepoint collation, this is simply the UTF-8 encoding, per its definition in terms of Unicode code points.