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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongcountCombinationsForFormat(String format) Takes in the passed in format and computes the number of possible combinationsgetAvailableCharactersForFormatElement(char formatElement) Determines for a given character what the available replacement characters are.protected voidsetCharMap(Map<Character, String> newMap)
-
Field Details
-
SPECIFY_LENGTH
-
-
Constructor Details
-
CodeFormatAvailableCharHelperImpl
public CodeFormatAvailableCharHelperImpl()
-
-
Method Details
-
getAvailableCharactersForFormatElement
Description copied from interface:CodeFormatAvailableCharHelperDetermines 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:
getAvailableCharactersForFormatElementin interfaceCodeFormatAvailableCharHelper- Returns:
-
countCombinationsForFormat
Takes in the passed in format and computes the number of possible combinations- Specified by:
countCombinationsForFormatin interfaceCodeFormatAvailableCharHelper- Parameters:
format-- Returns:
-
getCharMap
-
setCharMap
-