You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While most Prefix implementations use a Java enum, its values() method is only available in the actual implementation. Can we add a method to Prefix that works like SystemOfUnits.getUnits()?
Actually a static method ended up a better option. While SystemOfUnits returns a Set of units, an instance of Prefix does not have to return all other prefixes. At the moment the SystemOfUnitsService returns the Set given the name of a Prefixenum like "MetricPrefix".
While most
Prefix
implementations use a Javaenum
, itsvalues()
method is only available in the actual implementation. Can we add a method to Prefix that works likeSystemOfUnits.getUnits()
?For enum based implementations, it seems rather straightforward via:
return Collections.<Prefix>unmodifiableSet(EnumSet.allOf(MetricPrefix.class));
see https://stackoverflow.com/questions/6528570/converting-from-enumseta-to-setb-when-a-inherits-from-b
Hopefully easier vote on how to call this method?
The text was updated successfully, but these errors were encountered: