io.virtdata.conversions.from_double.ToByte Maven / Gradle / Ivy
package io.virtdata.conversions.from_double;
import io.virtdata.annotations.ThreadSafeMapper;
import java.util.function.DoubleFunction;
@ThreadSafeMapper
public class ToByte implements DoubleFunction {
private final int scale;
public ToByte() {
this.scale = Byte.MAX_VALUE;
}
public ToByte(int modulo) {
this.scale = modulo;
}
@Override
public Byte apply(double input) {
return (byte)(((long) input) % scale);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy