Class NaturalSortKeyBuilder

java.lang.Object
fr.paris.lutece.plugins.forms.util.NaturalSortKeyBuilder

public final class NaturalSortKeyBuilder extends Object
  • Field Details

    • FORMAT_VERSION

      public static final int FORMAT_VERSION
      Version of the binary key format. Bump on any change to build(String) : previously indexed keys are then no longer comparable with newly produced ones and a full reindexation is required.
      See Also:
  • Constructor Details

    • NaturalSortKeyBuilder

      public NaturalSortKeyBuilder()
      Creates a builder using the collation order shared by fr-FR and en under CLDR.
    • NaturalSortKeyBuilder

      public NaturalSortKeyBuilder(Locale locale)
      Creates a builder for an explicit collation locale.
      Parameters:
      locale - the collation locale, null meaning Locale.ENGLISH
  • Method Details

    • build

      public byte[] build(String strValue)
      Builds the sort key for a value.
      Parameters:
      strValue - the raw response value, may be null
      Returns:
      the binary sort key, never null ; empty for a null or empty input