com.ibm.commerce.promotion.uniquecode.generator

Interface Pattern

    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String COPYRIGHT
      IBM Copyright notice field.
    • Field Detail

      • COPYRIGHT

        static final java.lang.String COPYRIGHT
        IBM Copyright notice field.
        See Also:
        Constant Field Values
    • Method Detail

      • getCode

        java.lang.String getCode()
        This method returns a generated code

        The code must satisfy the pattern definition.

        Returns:
        The generated code
      • getPatternSpace

        java.math.BigDecimal getPatternSpace()
        This method calculates the total number of all possible codes

        The codes must satisfy the pattern definition.

        Returns:
        The total number of all possible codes
      • getPatternDefinition

        java.lang.String getPatternDefinition()
        This method returns the pattern definition
        Returns:
        The pattern string
      • setPatternDefinition

        void setPatternDefinition(java.lang.String patternDef)
        This method set the pattern definition
        Parameters:
        patternDef - The pattern string
      • getMaskCharacter

        char getMaskCharacter()
        This method returns the mask character of the pattern segment

        By default, the mask character should be the first character of the pattern definition.

        The CodeGenerator uses the mask character to parse the pattern string into pattern segments.

        Returns:
        The mask character
      • validatePattern

        boolean validatePattern()
        This method validates the pattern definition

        The CodeGenerator will use this method to validate the pattern string.

        This method returns true if the pattern definition is valid.

        Returns:
        The validate result