Class StringProvider

java.lang.Object
org.soliscode.test.provider.StringProvider
All Implemented Interfaces:
ObjectProvider<String>

public class StringProvider extends Object implements ObjectProvider<String>
Provides instances of an String for the purposes of testing.
Since:
1.0
Author:
evanbergstrom
See Also:
  • Constructor Details

    • StringProvider

      public StringProvider()
  • Method Details

    • defaultInstance

      @NotNull public @NotNull String defaultInstance()
      Description copied from interface: ObjectProvider
      Creates a single instance of class being tested using the default constructor.
      Specified by:
      defaultInstance in interface ObjectProvider<String>
      Returns:
      an instance of class.
    • createInstance

      @NotNull public @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.
      Specified by:
      createInstance in interface ObjectProvider<String>
      Parameters:
      seed - a primitive integer value.
      Returns:
      an instance of the String class
    • copyInstance

      @NotNull public @NotNull String copyInstance(@NotNull @NotNull String other)
      Creates a copy of the string value. Since instances of String are immutable, the copy is not performed and the value provided as an argument is returned.
      Specified by:
      copyInstance in interface ObjectProvider<String>
      Parameters:
      other - the string value to copy.
      Returns:
      the string value.
      Throws:
      NullPointerException - if the argument is null.