We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5014975 commit 7e6797eCopy full SHA for 7e6797e
1 file changed
src/main/java/mil/nga/crs/common/Units.java
@@ -286,6 +286,23 @@ public static Units fromUnit(Unit unit) {
286
return fromName(unit.getName());
287
}
288
289
+ /**
290
+ * Get the unit type from the name
291
+ *
292
+ * @param name
293
+ * unit name
294
+ * @return units type
295
+ * @since 1.1.0
296
+ */
297
+ public static UnitType getUnitType(String name) {
298
+ UnitType type = null;
299
+ Units unit = fromName(name);
300
+ if (unit != null) {
301
+ type = unit.getType();
302
+ }
303
+ return type;
304
305
+
306
/**
307
* Get the default unit for the unit type
308
*
0 commit comments