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

autofixture.generators.vavr.VavrCharSeqGenerator Maven / Gradle / Ivy

package autofixture.generators.vavr;

import autofixture.interfaces.FixtureContract;
import autofixture.interfaces.InstanceGenerator;
import autofixture.interfaces.InstanceType;
import com.google.common.reflect.TypeToken;
import io.vavr.collection.CharSeq;

public class VavrCharSeqGenerator implements InstanceGenerator {

  @Override
  public  boolean appliesTo(final InstanceType instanceType) {
    return instanceType.isRawTypeAssignableFrom(io.vavr.collection.CharSeq.class);
  }

  @Override
  public  T next(final InstanceType instanceType, final FixtureContract fixture) {
    return (T) CharSeq.ofAll(fixture.createMany(TypeToken.of(Character.class)));
  }

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

  @Override
  public void setOmittingAutoProperties(final boolean isOn) {

  }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy