com.bm.datagen.utils
Class BaseUniqueValueGenerator<T>

java.lang.Object
  extended by com.bm.datagen.utils.BaseUniqueValueGenerator<T>
Type Parameters:
T -
Direct Known Subclasses:
RandomDateGenerator, RandomIntegerGenerator, RandomLongGenerator, RandomStringGenerator

public abstract class BaseUniqueValueGenerator<T>
extends java.lang.Object

Hleper class which helps to generate unique values.

Author:
Daniel Wiese

Constructor Summary
BaseUniqueValueGenerator()
           
 
Method Summary
protected abstract  T generateCadidate()
          This method genrates a cadidate - thiscandidate will be automatcally checked for uniqueness
protected  T getUniqueValueForEachPkField(Property forProperty, Introspector<? extends java.lang.Object> introspector)
          Generates a unique value for each field (if the field is a PK field)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseUniqueValueGenerator

public BaseUniqueValueGenerator()
Method Detail

getUniqueValueForEachPkField

protected T getUniqueValueForEachPkField(Property forProperty,
                                         Introspector<? extends java.lang.Object> introspector)
Generates a unique value for each field (if the field is a PK field)

Parameters:
forProperty - -the field
introspector - - the introspector
Returns:
- a unique value

generateCadidate

protected abstract T generateCadidate()
This method genrates a cadidate - thiscandidate will be automatcally checked for uniqueness

Returns:
- a cadidate


Copyright © 2008. All Rights Reserved.