Class StringProvider
java.lang.Object
org.soliscode.test.provider.StringProvider
- All Implemented Interfaces:
ObjectProvider<String>
Provides instances of an
String
for the purposes of testing.- Since:
- 1.0
- Author:
- evanbergstrom
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull String
copyInstance
(@NotNull String other) Creates a copy of the string value.@NotNull String
createInstance
(int seed) Creates an instance of the string class with a value equal to the string representation of a primitive integer value.@NotNull String
Creates a single instance of class being tested using the default constructor.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.soliscode.test.provider.ObjectProvider
createEqualObjects, createInstance, createRandoInstances, createUniqueInstances, createUniqueInstances, equalInstanceSupplier, randomInstanceSupplier, uniqueInstanceSupplier, uniqueInstanceSupplier, uniqueSizeLimit
-
Constructor Details
-
StringProvider
public StringProvider()
-
-
Method Details
-
defaultInstance
Description copied from interface:ObjectProvider
Creates a single instance of class being tested using the default constructor.- Specified by:
defaultInstance
in interfaceObjectProvider<String>
- Returns:
- an instance of class.
-
createInstance
Creates an instance of the string class with a value equal to the string representation of a primitive integer value.- Specified by:
createInstance
in interfaceObjectProvider<String>
- Parameters:
seed
- a primitive integer value.- Returns:
- an instance of the
String
class
-
copyInstance
Creates a copy of the string value. Since instances ofString
are immutable, the copy is not performed and the value provided as an argument is returned.- Specified by:
copyInstance
in interfaceObjectProvider<String>
- Parameters:
other
- the string value to copy.- Returns:
- the string value.
- Throws:
NullPointerException
- if the argument isnull
.
-