Class CodeFormatAvailableCharHelperImpl

java.lang.Object
com.broadleafcommerce.advancedoffer.codes.service.CodeFormatAvailableCharHelperImpl
All Implemented Interfaces:
CodeFormatAvailableCharHelper

@Component("blCodeFormatAvailableCharHelper") public class CodeFormatAvailableCharHelperImpl extends Object implements CodeFormatAvailableCharHelper
Determines for a given character what the available replacement characters are.
Author:
bpolster
See Also:
  • CodeFormatAvailableCharSelector
  • Field Details

  • Constructor Details

    • CodeFormatAvailableCharHelperImpl

      public CodeFormatAvailableCharHelperImpl()
  • Method Details

    • getAvailableCharactersForFormatElement

      public String getAvailableCharactersForFormatElement(char formatElement)
      Description copied from interface: CodeFormatAvailableCharHelper
      Determines for a given character what the available replacement characters are.

      For example, in a codeFormat of "AB-##", the "#" characater might be replaceable with any number.

      By default, Broadleaf will replace the codes "#" with numbers, "@" with letters, and "*" with alphanumerics.

      In all cases, commonly confused letters and numbers are removed which include (0,O, 1, L, 5, S)

      Specified by:
      getAvailableCharactersForFormatElement in interface CodeFormatAvailableCharHelper
      Returns:
    • countCombinationsForFormat

      public long countCombinationsForFormat(String format)
      Takes in the passed in format and computes the number of possible combinations
      Specified by:
      countCombinationsForFormat in interface CodeFormatAvailableCharHelper
      Parameters:
      format -
      Returns:
    • getCharMap

      protected Map<Character,String> getCharMap()
    • setCharMap

      protected void setCharMap(Map<Character,String> newMap)