public interface DataProviderStrategy
PODAM is a tool to fill POJOs with data. There are different requirements
when it comes to which data POJOs should be filled with. The default strategy
adopted by PODAM is to fill POJOs with random data. However other
requirements might dictate to assign deterministic data using sequences, or
other predictable sources of data. In order to do so, clients of PODAM will
have to provide an implementation of this interface and pass it to the
constructor of the PodamFactoryImpl class.
| Modifier and Type | Method and Description |
|---|---|
Boolean |
getBoolean(AttributeMetadata attributeMetadata)
It returns a boolean/Boolean value.
|
Byte |
getByte(AttributeMetadata attributeMetadata)
It returns a byte/Byte value.
|
Byte |
getByteInRange(byte minValue,
byte maxValue,
AttributeMetadata attributeMetadata)
It returns a byte/Byte within min and max value (included).
|
Character |
getCharacter(AttributeMetadata attributeMetadata)
It returns a char/Character value.
|
Character |
getCharacterInRange(char minValue,
char maxValue,
AttributeMetadata attributeMetadata)
It returns a char/Character value between min and max value (included).
|
Double |
getDouble(AttributeMetadata attributeMetadata)
It returns a double/Double value
|
Double |
getDoubleInRange(double minValue,
double maxValue,
AttributeMetadata attributeMetadata)
It returns a double/Double value between min and max value (included).
|
Set<Class<? extends Annotation>> |
getExcludedAnnotations()
Identifies
Annotations for fields to be skipped. |
Float |
getFloat(AttributeMetadata attributeMetadata)
It returns a float/Float value.
|
Float |
getFloatInRange(float minValue,
float maxValue,
AttributeMetadata attributeMetadata)
It returns a float/Float value between min and max value (included).
|
Integer |
getInteger(AttributeMetadata attributeMetadata)
It returns an int/Integer value.
|
int |
getIntegerInRange(int minValue,
int maxValue,
AttributeMetadata attributeMetadata)
It returns an int/Integer value between min and max value (included).
|
Long |
getLong(AttributeMetadata attributeMetadata)
It returns a long/Long value.
|
Long |
getLongInRange(long minValue,
long maxValue,
AttributeMetadata attributeMetadata)
It returns a long/Long value between min and max value (included).
|
int |
getMaxDepth(Class<?> type)
Returns how many times it is allowed to PODAM to create an instance
of the same class in a recursive hierarchy
|
int |
getNumberOfCollectionElements(Class<?> type)
Returns the number of default collection elements.
|
Short |
getShort(AttributeMetadata attributeMetadata)
It returns a short/Short value.
|
Short |
getShortInRange(short minValue,
short maxValue,
AttributeMetadata attributeMetadata)
It returns a short/Short value between min and max value (included).
|
<T> Class<? extends T> |
getSpecificClass(Class<T> nonInstantiatableClass)
Resolves abstract classes and interfaces.
|
String |
getStringOfLength(int length,
AttributeMetadata attributeMetadata)
It returns a String of
length characters. |
String |
getStringValue(AttributeMetadata attributeMetadata)
It returns a string value
|
boolean |
isMemoizationEnabled()
Returns whether the memoization setting is enabled.
|
void |
sort(Constructor<?>[] constructors)
Rearranges POJO's constructors in order they will be tried to
produce the POJO.
|
void |
sort(Method[] methods)
Rearranges POJO's methods in order they will be tried to
produce the POJO.
|
Boolean getBoolean(AttributeMetadata attributeMetadata)
Byte getByte(AttributeMetadata attributeMetadata)
Byte getByteInRange(byte minValue, byte maxValue, AttributeMetadata attributeMetadata)
minValue - The minimum value for the returned valuemaxValue - The maximum value for the returned valueCharacter getCharacter(AttributeMetadata attributeMetadata)
Character getCharacterInRange(char minValue, char maxValue, AttributeMetadata attributeMetadata)
minValue - The minimum value for the returned valuemaxValue - The maximum value for the returned valueDouble getDouble(AttributeMetadata attributeMetadata)
Double getDoubleInRange(double minValue, double maxValue, AttributeMetadata attributeMetadata)
minValue - The minimum value for the returned valuemaxValue - The maximum value for the returned valueFloat getFloat(AttributeMetadata attributeMetadata)
Float getFloatInRange(float minValue, float maxValue, AttributeMetadata attributeMetadata)
minValue - The minimum value for the returned valuemaxValue - The maximum value for the returned valueInteger getInteger(AttributeMetadata attributeMetadata)
int getIntegerInRange(int minValue,
int maxValue,
AttributeMetadata attributeMetadata)
minValue - The minimum value for the returned valuemaxValue - The maximum value for the returned valueLong getLong(AttributeMetadata attributeMetadata)
Long getLongInRange(long minValue, long maxValue, AttributeMetadata attributeMetadata)
minValue - The minimum value for the returned valuemaxValue - The maximum value for the returned valueShort getShort(AttributeMetadata attributeMetadata)
Short getShortInRange(short minValue, short maxValue, AttributeMetadata attributeMetadata)
minValue - The minimum value for the returned valuemaxValue - The maximum value for the returned valueString getStringValue(AttributeMetadata attributeMetadata)
String getStringOfLength(int length, AttributeMetadata attributeMetadata)
length characters.length - The number of characters required in the returned Stringlength charactersint getNumberOfCollectionElements(Class<?> type)
Implementations of this interface need to provide this value.
type - Type of collection's elementsint getMaxDepth(Class<?> type)
Implementations of this interface need to provide this value.
type - Type of POJO to be createdboolean isMemoizationEnabled()
Implementations of this interface need to provide this value.
void sort(Constructor<?>[] constructors)
constructors - Array of POJO's constructorsvoid sort(Method[] methods)
methods - Array of POJO's methods<T> Class<? extends T> getSpecificClass(Class<T> nonInstantiatableClass)
Should return specific class type, which can be instantiated and assigned to abstract class type or interface.
nonInstantiatableClass - Abstract class type or interfacenonInstantiatableClass.Set<Class<? extends Annotation>> getExcludedAnnotations()
Annotations for fields to be skipped.
Should return set of annotations, which will be treated as notion for
PodamFactory to skip production of these particular fields.
Copyright © 2015. All rights reserved.