Class SerialGeneratorFactory


  • public class SerialGeneratorFactory
    extends GeneratorFactory
    GeneratorFactory implementation which provides serial value generation and parallel combinations.

    Created: 22.07.2011 10:14:36
    Since:
    0.7.0
    Author:
    Volker Bergmann
    • Constructor Detail

      • SerialGeneratorFactory

        public SerialGeneratorFactory()
        Instantiates a new Serial generator factory.
    • Method Detail

      • createAlternativeGenerator

        public <T> Generator<T> createAlternativeGenerator​(java.lang.Class<T> targetType,
                                                           Generator<T>[] sources,
                                                           Uniqueness uniqueness)
        Description copied from class: GeneratorFactory
        Create alternative generator generator.
        Specified by:
        createAlternativeGenerator in class GeneratorFactory
        Type Parameters:
        T - the type parameter
        Parameters:
        targetType - the target type
        sources - the sources
        uniqueness - the uniqueness
        Returns:
        the generator
      • createCompositeArrayGenerator

        public <T> Generator<T[]> createCompositeArrayGenerator​(java.lang.Class<T> componentType,
                                                                Generator<T>[] sources,
                                                                Uniqueness uniqueness)
        Description copied from class: GeneratorFactory
        Creates a generator that reads products of an array of generators and combines them in an array.
        Specified by:
        createCompositeArrayGenerator in class GeneratorFactory
        Type Parameters:
        T - the type parameter
        Parameters:
        componentType - the component type
        sources - the source generators
        uniqueness - the uniqueness
        Returns:
        a generator of the desired characteristics
      • createSampleGenerator

        public <T> Generator<T> createSampleGenerator​(java.util.Collection<T> values,
                                                      java.lang.Class<T> generatedType,
                                                      boolean unique)
        Description copied from class: GeneratorFactory
        Create sample generator generator.
        Specified by:
        createSampleGenerator in class GeneratorFactory
        Type Parameters:
        T - the type parameter
        Parameters:
        values - the values
        generatedType - the generated type
        unique - the unique
        Returns:
        the generator
      • createFromWeightedLiteralList

        public <T> Generator<T> createFromWeightedLiteralList​(java.lang.String valueSpec,
                                                              java.lang.Class<T> targetType,
                                                              Distribution distribution,
                                                              boolean unique)
        Description copied from class: GeneratorFactory
        Create from weighted literal list generator.
        Specified by:
        createFromWeightedLiteralList in class GeneratorFactory
        Type Parameters:
        T - the type parameter
        Parameters:
        valueSpec - the value spec
        targetType - the target type
        distribution - the distribution
        unique - the unique
        Returns:
        the generator
      • createWeightedSampleGenerator

        public <T> Generator<T> createWeightedSampleGenerator​(java.util.Collection<com.rapiddweller.script.WeightedSample<T>> samples,
                                                              java.lang.Class<T> targetType)
        Description copied from class: GeneratorFactory
        Creates a generator that chooses from a set of samples, using an individual weight for each sample.
        Overrides:
        createWeightedSampleGenerator in class GeneratorFactory
        Type Parameters:
        T - the type parameter
        Parameters:
        samples - A collection of sample values
        targetType - the target type
        Returns:
        a generator of the desired characteristics
      • createDateGenerator

        public Generator<java.util.Date> createDateGenerator​(java.util.Date min,
                                                             java.util.Date max,
                                                             long granularity,
                                                             Distribution distribution)
        Description copied from class: GeneratorFactory
        Creates a Date generator that generates random dates.
        Overrides:
        createDateGenerator in class GeneratorFactory
        Parameters:
        min - the earliest Date to generate
        max - the latest Date to generate
        granularity - the time resolution of dates in milliseconds
        distribution - the distribution to use
        Returns:
        a generator of the desired characteristics
      • createNumberGenerator

        public <T extends java.lang.Number> NonNullGenerator<T> createNumberGenerator​(java.lang.Class<T> numberType,
                                                                                      T min,
                                                                                      java.lang.Boolean minInclusive,
                                                                                      T max,
                                                                                      java.lang.Boolean maxInclusive,
                                                                                      T granularity,
                                                                                      Distribution distribution,
                                                                                      Uniqueness uniqueness)
        Description copied from class: GeneratorFactory
        Creates a generator for numbers.
        Overrides:
        createNumberGenerator in class GeneratorFactory
        Type Parameters:
        T - the type parameter
        Parameters:
        numberType - the number type, e.g. java.lang.Integer
        min - the minimum number to generate
        minInclusive - the min inclusive
        max - the maximum number to generate
        maxInclusive - the max inclusive
        granularity - the resolution to use in number generation.
        distribution - The Sequence of WeightFunction to use for generation
        uniqueness - the uniqueness
        Returns:
        a Number generator of the desired characteristics
      • createStringGenerator

        public NonNullGenerator<java.lang.String> createStringGenerator​(java.util.Set<java.lang.Character> chars,
                                                                        java.lang.Integer minLength,
                                                                        java.lang.Integer maxLength,
                                                                        int lengthGranularity,
                                                                        Distribution lengthDistribution,
                                                                        Uniqueness uniqueness)
        Description copied from class: GeneratorFactory
        Create string generator non null generator.
        Specified by:
        createStringGenerator in class GeneratorFactory
        Parameters:
        chars - the chars
        minLength - the min length
        maxLength - the max length
        lengthGranularity - the length granularity
        lengthDistribution - the length distribution
        uniqueness - the uniqueness
        Returns:
        the non null generator
      • createCompositeStringGenerator

        public NonNullGenerator<java.lang.String> createCompositeStringGenerator​(GeneratorProvider<?> partGeneratorProvider,
                                                                                 int minParts,
                                                                                 int maxParts,
                                                                                 Uniqueness uniqueness)
        Description copied from class: GeneratorFactory
        Create composite string generator non null generator.
        Specified by:
        createCompositeStringGenerator in class GeneratorFactory
        Parameters:
        partGeneratorProvider - the part generator provider
        minParts - the min parts
        maxParts - the max parts
        uniqueness - the uniqueness
        Returns:
        the non null generator
      • createCharacterGenerator

        public Generator<java.lang.Character> createCharacterGenerator​(java.lang.String pattern,
                                                                       java.util.Locale locale,
                                                                       boolean unique)
        Description copied from class: GeneratorFactory
        Creates a Character generator that creates characters of a Locale which match a regular expression.
        Overrides:
        createCharacterGenerator in class GeneratorFactory
        Parameters:
        pattern - the regular expression that indicates the available range of values. If null, any letters of the specified locale will be used
        locale - the locale to use for '\w' evaluation
        unique - flag indicating if character generation should be unique
        Returns:
        a generator of the desired characteristics
      • createCharacterGenerator

        public NonNullGenerator<java.lang.Character> createCharacterGenerator​(java.util.Set<java.lang.Character> characters)
        Description copied from class: GeneratorFactory
        Creates a character generator that creates values from a collection of characters
        Overrides:
        createCharacterGenerator in class GeneratorFactory
        Parameters:
        characters - the set of characters to choose from
        Returns:
        a generator of the desired characteristics
      • defaultCounts

        protected java.util.Set<java.lang.Integer> defaultCounts​(int minCount,
                                                                 int maxCount,
                                                                 int countPrecision)
        Default counts set.
        Parameters:
        minCount - the min count
        maxCount - the max count
        countPrecision - the count precision
        Returns:
        the set
      • createSingleValueGenerator

        public <T> Generator<T> createSingleValueGenerator​(T value,
                                                           boolean unique)
        Description copied from class: GeneratorFactory
        Creates a generator that returns a single value.
        Specified by:
        createSingleValueGenerator in class GeneratorFactory
        Type Parameters:
        T - the type parameter
        Parameters:
        value - the value to return
        unique - the unique
        Returns:
        a generator that returns a constant value.
      • createNullGenerator

        public <T> Generator<T> createNullGenerator​(java.lang.Class<T> generatedType)
        Description copied from class: GeneratorFactory
        Create null generator generator.
        Specified by:
        createNullGenerator in class GeneratorFactory
        Type Parameters:
        T - the type parameter
        Parameters:
        generatedType - the generated type
        Returns:
        the generator
      • defaultSubSet

        public java.util.Set<java.lang.Character> defaultSubSet​(java.util.Set<java.lang.Character> characters)
        Description copied from class: GeneratorFactory
        Default sub set set.
        Overrides:
        defaultSubSet in class GeneratorFactory
        Parameters:
        characters - the characters
        Returns:
        the set
      • applyNullSettings

        public Generator<?> applyNullSettings​(Generator<?> source,
                                              java.lang.Boolean nullable,
                                              java.lang.Double nullQuota)
        Description copied from class: GeneratorFactory
        Apply null settings generator.
        Specified by:
        applyNullSettings in class GeneratorFactory
        Parameters:
        source - the source
        nullable - the nullable
        nullQuota - the null quota
        Returns:
        the generator