Interface Mod10GeneratorSpec

All Superinterfaces:
GeneratorSpec<String>, NullableGeneratorSpec<String>
All Known Subinterfaces:
Mod10AsGeneratorSpec, Mod10Spec

public interface Mod10GeneratorSpec extends NullableGeneratorSpec<String>
A spec for generating numbers that pass the Mod10 checksum algorithm.

The methods provided by this interface (as well as their Javadocs) were copied from the org.hibernate.validator.constraints.Mod10Check annotation attributes.

Since:
2.16.0
  • Method Details

    • length

      Mod10GeneratorSpec length(int length)
      Length of the number to generate (default value is 16).
      Parameters:
      length - of the number to generate
      Returns:
      spec builder
      Since:
      2.16.0
    • multiplier

      Mod10GeneratorSpec multiplier(int multiplier)
      Multiplier to be used for odd digits when calculating the Mod10 checksum (default value is 3).
      Parameters:
      multiplier - for odd digits
      Returns:
      spec builder
      Since:
      2.16.0
    • weight

      Mod10GeneratorSpec weight(int weight)
      The weight to be used for even digits when calculating the Mod10 checksum (default value is 1).
      Parameters:
      weight - for even digits
      Returns:
      spec builder
      Since:
      2.16.0
    • startIndex

      Mod10GeneratorSpec startIndex(int startIndex)
      The start index for calculating the checksum (default value is 0).
      Parameters:
      startIndex - for calculating the checksum (inclusive)
      Returns:
      spec builder
      Since:
      2.16.0
    • endIndex

      Mod10GeneratorSpec endIndex(int endIndex)
      The end index for calculating the checksum.
      Parameters:
      endIndex - for calculating the checksum (inclusive)
      Returns:
      spec builder
      Since:
      2.16.0
    • checkDigitIndex

      Mod10GeneratorSpec checkDigitIndex(int checkDigitIndex)
      The index of the check digit in the input. If not specified, the last digit will be used as the check digit.

      If set, the digit at the specified index is used. If set the following must hold true:
      checkDigitIndex >= 0 && (checkDigitIndex < startIndex || checkDigitIndex >= endIndex).

      Parameters:
      checkDigitIndex - index of the check digit
      Returns:
      spec builder
      Since:
      2.16.0
    • nullable

      Mod10GeneratorSpec nullable()
      Indicates that null value can be generated.
      Specified by:
      nullable in interface NullableGeneratorSpec<String>
      Returns:
      spec builder
      Since:
      2.16.0