final Unit<?> unit = descriptor.getUnit();
if (unit != null) {
return new MeasurementRange((Class) valueClass,
(Number) minimumValue, true, (Number) maximumValue, true, unit);
} else if (minimumValue != null || maximumValue != null) {
return new NumberRange((Class) valueClass,
(Number) minimumValue, true, (Number) maximumValue, true);
}
} else if (minimumValue != null || maximumValue != null) {
return new Range(valueClass, minimumValue, true, maximumValue, true);
}