Class BigDecimalRandomizer

  • All Implemented Interfaces:
    Randomizer<java.math.BigDecimal>

    public class BigDecimalRandomizer
    extends java.lang.Object
    implements Randomizer<java.math.BigDecimal>
    Generate a random BigDecimal.
    Author:
    Mahmoud Ben Hassine (mahmoud.benhassine@icloud.com)
    • Constructor Detail

      • BigDecimalRandomizer

        public BigDecimalRandomizer​(long seed)
        Create a new BigDecimalRandomizer.
        Parameters:
        seed - initial seed
      • BigDecimalRandomizer

        public BigDecimalRandomizer​(java.lang.Integer scale)
        Create a new BigDecimalRandomizer. The default rounding mode is RoundingMode.HALF_UP.
        Parameters:
        scale - of the BigDecimal value to be returned.
      • BigDecimalRandomizer

        public BigDecimalRandomizer​(java.lang.Integer scale,
                                    java.math.RoundingMode roundingMode)
        Create a new BigDecimalRandomizer.
        Parameters:
        scale - of the BigDecimal value to be returned.
        roundingMode - of the BigDecimal value to be returned.
      • BigDecimalRandomizer

        public BigDecimalRandomizer​(long seed,
                                    java.lang.Integer scale,
                                    java.math.RoundingMode roundingMode)
        Create a new BigDecimalRandomizer.
        Parameters:
        scale - of the BigDecimal value to be returned.
        roundingMode - of the BigDecimal value to be returned.
    • Method Detail

      • getRandomValue

        public java.math.BigDecimal getRandomValue()
        Description copied from interface: Randomizer
        Generate a random value for the given type.
        Specified by:
        getRandomValue in interface Randomizer<java.math.BigDecimal>
        Returns:
        a random value for the given type