Also use javax.measure.quantity.Length for length values instead of float or double.
javax.measure.quantity.Length
float
double