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

autofixture.generators.StringGenerator Maven / Gradle / Ivy

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  boolean appliesTo(final InstanceType clazz) {
    return clazz.isRawTypeAssignableFrom(String.class);
  }

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

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy