autofixture.generators.time.ZoneOffsetGenerator Maven / Gradle / Ivy
package autofixture.generators.time;
import autofixture.interfaces.FixtureContract;
import autofixture.interfaces.InstanceGenerator;
import autofixture.interfaces.InstanceType;
import java.time.ZoneOffset;
/**
* Created by astral on 08.02.15.
*/
public class ZoneOffsetGenerator implements InstanceGenerator {
@Override
public boolean appliesTo(final InstanceType instanceType) {
return instanceType.isRawTypeAssignableFrom(ZoneOffset.class);
}
@Override
public T next(final InstanceType instanceType, final FixtureContract fixture) {
return (T) ZoneOffset.ofTotalSeconds(fixture.create(Integer.class));
}
@Override
public void setOmittingAutoProperties(final boolean isOn) {
}
}