Package dev.orne.test.rnd
Class Generators.MissingGenerator
java.lang.Object
dev.orne.test.rnd.Generators.MissingGenerator
- All Implemented Interfaces:
Generator
- Enclosing class:
- Generators
@API(status=INTERNAL,
since="0.1")
public static final class Generators.MissingGenerator
extends Object
implements Generator
Cache value for missing generators for a value type.
- Since:
- Generators 1.0
- Version:
- 1.0, 2022-10
- Author:
- (w) Iker Hernaez
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe error message.static final Generators.MissingGeneratorThe generator placeholder for missing generators. -
Method Summary
Modifier and TypeMethodDescription<T> TdefaultValue(@NotNull Class<T> type) Returns the default value for the specified type.<T> TnullableDefaultValue(@NotNull Class<T> type) Returns the default value for the specified type allowingnullvalues.<T> TnullableRandomValue(@NotNull Class<T> type) Returns a random value of the specified type allowingnullvalues.<T> TrandomValue(@NotNull Class<T> type) Returns a random value of the specified type.booleanChecks if values of the specified type can be generated by this instance.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.orne.test.rnd.Generator
asParameterizable, getPriority
-
Field Details
-
ERR_MSG
The error message.- See Also:
-
INSTANCE
The generator placeholder for missing generators.
-
-
Method Details
-
supports
Checks if values of the specified type can be generated by this instance. -
defaultValue
Returns the default value for the specified type.- Specified by:
defaultValuein interfaceGenerator- Type Parameters:
T- The requested value type.- Parameters:
type- The requested value type.- Returns:
- The default value for the specified type.
-
nullableDefaultValue
Returns the default value for the specified type allowingnullvalues.This method should return
nullexcept for native types.- Specified by:
nullableDefaultValuein interfaceGenerator- Type Parameters:
T- The requested value type.- Parameters:
type- The requested value type.- Returns:
- The nullable default value for the specified type.
-
randomValue
Returns a random value of the specified type.- Specified by:
randomValuein interfaceGenerator- Type Parameters:
T- The requested value type.- Parameters:
type- The requested value type.- Returns:
- A random value for the specified type.
-
nullableRandomValue
Returns a random value of the specified type allowingnullvalues.The returned value has a probability of be
nullexcept for native types. If notnullbehaves asrandomValue().- Specified by:
nullableRandomValuein interfaceGenerator- Type Parameters:
T- The requested value type.- Parameters:
type- The requested value type.- Returns:
- A random nullable value for the specified type.
- See Also:
-