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

autofixture.generators.StringGenerator Maven / Gradle / Ivy

There is a newer version: 2.1.10
Show newest version
package autofixture.generators;

import autofixture.interfaces.FixtureContract;
import autofixture.interfaces.InstanceGenerator;
import autofixture.interfaces.InstanceType;

import java.util.UUID;

public class StringGenerator implements InstanceGenerator {

  @Override
  @SuppressWarnings("unchecked")
  public  T next(final InstanceType clazz, final FixtureContract fixture) {
    return (T) UUID.randomUUID().toString();
  }

  @Override
  public  T nextEmpty(final InstanceType instanceType, final FixtureContract fixture) {
    return next(instanceType, fixture);
  }

  @Override
  public  boolean appliesTo(final InstanceType clazz) {
    return clazz.isRawTypeAssignableFrom(String.class);
  }

  @Override
  public void setOmittingAutoProperties(final boolean isOn) {
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy