org.databene.benerator.primitive
Class UniqueScrambledStringGenerator

java.lang.Object
  extended by org.databene.benerator.util.AbstractGenerator<P>
      extended by org.databene.benerator.wrapper.MultiGeneratorWrapper<java.lang.String,java.lang.String>
          extended by org.databene.benerator.primitive.UniqueScrambledStringGenerator
All Implemented Interfaces:
java.io.Closeable, Generator<java.lang.String>, NonNullGenerator<java.lang.String>, VarLengthStringGenerator, org.databene.commons.Resettable, org.databene.commons.ThreadAware

public class UniqueScrambledStringGenerator
extends MultiGeneratorWrapper<java.lang.String,java.lang.String>
implements VarLengthStringGenerator

Generates unique strings of variable length.

Created: 16.11.2007 11:56:15

Author:
Volker Bergmann

Field Summary
 
Fields inherited from class org.databene.benerator.wrapper.MultiGeneratorWrapper
generatedType, sources
 
Fields inherited from class org.databene.benerator.util.AbstractGenerator
context, logger, state
 
Constructor Summary
UniqueScrambledStringGenerator()
           
UniqueScrambledStringGenerator(java.util.Set<java.lang.Character> chars, int minLength, int maxLength)
           
 
Method Summary
 java.lang.String generate()
           
 ProductWrapper<java.lang.String> generate(ProductWrapper<java.lang.String> wrapper)
          Returns an instance of the generic type E, using the ProductWrapper instance provided as argument.
 java.lang.String generateWithLength(int length)
           
 int getMaxLength()
           
 int getMinLength()
           
 void init(GeneratorContext context)
           
 void setMaxLength(int maxLength)
           
 void setMinLength(int minLength)
           
 java.lang.String toString()
           
 
Methods inherited from class org.databene.benerator.wrapper.MultiGeneratorWrapper
addSource, availableSourceCount, close, generateFromAllSources, generateFromAvailableSource, generateFromRandomSource, generateFromSource, getAvailableSource, getGeneratedType, getSource, getSources, getSourceWrapper, isParallelizable, isThreadSafe, reset, setSources
 
Methods inherited from class org.databene.benerator.util.AbstractGenerator
assertInitialized, assertNotInitialized, getResultWrapper, wasInitialized
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.databene.benerator.Generator
close, getGeneratedType, wasInitialized
 
Methods inherited from interface org.databene.commons.ThreadAware
isParallelizable, isThreadSafe
 
Methods inherited from interface org.databene.commons.Resettable
reset
 

Constructor Detail

UniqueScrambledStringGenerator

public UniqueScrambledStringGenerator()

UniqueScrambledStringGenerator

public UniqueScrambledStringGenerator(java.util.Set<java.lang.Character> chars,
                                      int minLength,
                                      int maxLength)
Method Detail

getMinLength

public int getMinLength()

setMinLength

public void setMinLength(int minLength)

getMaxLength

public int getMaxLength()

setMaxLength

public void setMaxLength(int maxLength)

init

public void init(GeneratorContext context)
Specified by:
init in interface Generator<java.lang.String>
Overrides:
init in class MultiGeneratorWrapper<java.lang.String,java.lang.String>

generateWithLength

public java.lang.String generateWithLength(int length)
Specified by:
generateWithLength in interface VarLengthStringGenerator

generate

public ProductWrapper<java.lang.String> generate(ProductWrapper<java.lang.String> wrapper)
Description copied from interface: Generator
Returns an instance of the generic type E, using the ProductWrapper instance provided as argument. The wrapper may wrap a null value as a regular generator product. If the generator is not available (any more), it returns null instead of the ProductWrapper instance.

Specified by:
generate in interface Generator<java.lang.String>

generate

public java.lang.String generate()
Specified by:
generate in interface NonNullGenerator<java.lang.String>

toString

public java.lang.String toString()
Overrides:
toString in class MultiGeneratorWrapper<java.lang.String,java.lang.String>


Copyright © 2013. All Rights Reserved.