autofixture.generators.numbers.FloatSequenceGenerator Maven / Gradle / Ivy
package autofixture.generators.numbers;
import autofixture.interfaces.FixtureContract;
import autofixture.interfaces.InstanceGenerator;
import autofixture.interfaces.InstanceType;
public class FloatSequenceGenerator implements InstanceGenerator {
public static final double ARBITRARY_FLOATING_POINT_VALUE = 0.6;
private Float startingNumber = (float)ARBITRARY_FLOATING_POINT_VALUE;
@Override
public boolean appliesTo(final InstanceType typeToken) {
return typeToken.isCompatibleWithAnyOf(Float.class);
}
@SuppressWarnings("unchecked")
@Override
public T next(final InstanceType typeToken, final FixtureContract fixture) {
return (T) (startingNumber++);
}
@Override
public void setOmittingAutoProperties(final boolean isOn) {
}
}