![JAR search and dependency download from the Maven repository](/logo.png)
autofixture.generators.numbers.BigDecimalGenerator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of autofixturegenerator Show documentation
Show all versions of autofixturegenerator Show documentation
An attempt to reimplement core features of a popular .NET anonymous value generator - AutoFixture - in
Java
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 T nextEmpty(final InstanceType instanceType, final FixtureContract fixture) {
return next(instanceType, fixture);
}
@Override
public void setOmittingAutoProperties(final boolean isOn) {
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy