All Downloads are FREE. Search and download functionalities are using the official Maven repository.

autofixture.publicinterface.inline.strings.AlphaStringGenerator Maven / Gradle / Ivy

There is a newer version: 2.1.10
Show newest version
package autofixture.publicinterface.inline.strings;

import autofixture.interfaces.FixtureContract;
import autofixture.interfaces.InlineInstanceGenerator;

public class AlphaStringGenerator implements InlineInstanceGenerator {

  private final InlineInstanceGenerator alphaCharGenerator;
  private final int length;

  public AlphaStringGenerator(
      final InlineInstanceGenerator alphaCharGenerator, final int length) {
    this.alphaCharGenerator = alphaCharGenerator;
    this.length = length;
  }

  @Override
  public String next(final FixtureContract fixture) {
    final StringBuilder result = new StringBuilder();
    for (int i = 0; i < length; ++i) {
      result.append(alphaCharGenerator.next(fixture));
    }

    return result.toString();
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy