Package org.jeasy.random.randomizers
Class AbstractRandomizer<T>
- java.lang.Object
-
- org.jeasy.random.randomizers.AbstractRandomizer<T>
-
- All Implemented Interfaces:
Randomizer<T>
- Direct Known Subclasses:
AbstractRangeRandomizer,BigIntegerRandomizer,BooleanRandomizer,CharacterRandomizer,DoubleRandomizer,EnumRandomizer,FloatRandomizer,IntegerRandomizer,LocaleRandomizer,LongRandomizer,NumberRandomizer,OptionalRandomizer,ShortRandomizer,StringRandomizer,TimeZoneRandomizer,UriRandomizer,UrlRandomizer,UUIDRandomizer,ZonedDateTimeRandomizer,ZoneIdRandomizer
public abstract class AbstractRandomizer<T> extends java.lang.Object implements Randomizer<T>
Base class forRandomizerimplementations.- Author:
- Mahmoud Ben Hassine (mahmoud.benhassine@icloud.com)
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Randomrandom
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractRandomizer()protectedAbstractRandomizer(long seed)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.String[]getPredefinedValuesOf(java.lang.String key)protected doublenextDouble(double min, double max)Return a random double in the given range.java.lang.StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.jeasy.random.api.Randomizer
getRandomValue
-
-
-
-
Method Detail
-
getPredefinedValuesOf
protected java.lang.String[] getPredefinedValuesOf(java.lang.String key)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
nextDouble
protected double nextDouble(double min, double max)Return a random double in the given range.- Parameters:
min- value (inclusive)max- value (exclusive)- Returns:
- random double in the given range
-
-