autofixture.generators.numbers.BigDecimalGenerator Maven / Gradle / Ivy
package autofixture.generators.numbers;
import autofixture.interfaces.FixtureContract;
import autofixture.interfaces.InstanceGenerator;
import autofixture.interfaces.InstanceType;
import java.math.BigDecimal;
public class BigDecimalGenerator implements InstanceGenerator {
@Override
public boolean appliesTo(final InstanceType typeToken) {
return typeToken.isAssignableFrom(BigDecimal.class);
}
@SuppressWarnings("unchecked")
@Override
public T next(final InstanceType typeToken, final FixtureContract fixture) {
return (T) new BigDecimal(fixture.create(Integer.class));
}
@Override
public void setOmittingAutoProperties(final boolean isOn) {
}
}