]> git.basschouten.com Git - openhab-addons.git/blob
0c71513d66b22f426f3aa0956070c4838cd3cf71
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2020 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
7  * This program and the accompanying materials are made available under the
8  * terms of the Eclipse Public License 2.0 which is available at
9  * http://www.eclipse.org/legal/epl-2.0
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.bluetooth.generic.internal;
14
15 import java.math.BigInteger;
16 import java.util.UUID;
17
18 import javax.measure.Quantity;
19 import javax.measure.Unit;
20 import javax.measure.quantity.Angle;
21 import javax.measure.quantity.Area;
22 import javax.measure.quantity.Dimensionless;
23 import javax.measure.quantity.ElectricCharge;
24 import javax.measure.quantity.Frequency;
25 import javax.measure.quantity.Length;
26 import javax.measure.quantity.Mass;
27 import javax.measure.quantity.Speed;
28
29 import org.eclipse.jdt.annotation.NonNullByDefault;
30 import org.eclipse.jdt.annotation.Nullable;
31 import org.openhab.binding.bluetooth.BluetoothBindingConstants;
32 import org.openhab.core.library.dimension.ArealDensity;
33 import org.openhab.core.library.dimension.VolumetricFlowRate;
34 import org.openhab.core.library.unit.ImperialUnits;
35 import org.openhab.core.library.unit.MetricPrefix;
36 import org.openhab.core.library.unit.SIUnits;
37 import org.openhab.core.library.unit.Units;
38
39 import tec.uom.se.format.SimpleUnitFormat;
40 import tec.uom.se.function.MultiplyConverter;
41 import tec.uom.se.function.PiMultiplierConverter;
42 import tec.uom.se.function.RationalConverter;
43 import tec.uom.se.unit.ProductUnit;
44 import tec.uom.se.unit.TransformedUnit;
45
46 /**
47  * The {@link BluetoothUnit} maps bluetooth units to openHAB units.
48  *
49  * @author Connor Petty - Initial contribution
50  */
51 @NonNullByDefault
52 public enum BluetoothUnit {
53
54     UNITLESS(0x2700, "org.bluetooth.unit.unitless", Units.ONE),
55     METRE(0x2701, "org.bluetooth.unit.length.metre", SIUnits.METRE),
56     KILOGRAM(0x2702, "org.bluetooth.unit.mass.kilogram", SIUnits.KILOGRAM),
57     SECOND(0x2703, "org.bluetooth.unit.time.second", Units.SECOND),
58     AMPERE(0x2704, "org.bluetooth.unit.electric_current.ampere", Units.AMPERE),
59     KELVIN(0x2705, "org.bluetooth.unit.thermodynamic_temperature.kelvin", Units.KELVIN),
60     MOLE(0x2706, "org.bluetooth.unit.amount_of_substance.mole", Units.MOLE),
61     CANDELA(0x2707, "org.bluetooth.unit.luminous_intensity.candela", Units.CANDELA),
62     SQUARE_METRES(0x2710, "org.bluetooth.unit.area.square_metres", SIUnits.SQUARE_METRE),
63     CUBIC_METRES(0x2711, "org.bluetooth.unit.volume.cubic_metres", SIUnits.CUBIC_METRE),
64     METRE_PER_SECOND(0x2712, "org.bluetooth.unit.velocity.metres_per_second", Units.METRE_PER_SECOND),
65     METRE_PER_SQUARE_SECOND(0X2713, "org.bluetooth.unit.acceleration.metres_per_second_squared",
66             Units.METRE_PER_SQUARE_SECOND),
67     WAVENUMBER(0x2714, "org.bluetooth.unit.wavenumber.reciprocal_metre", Units.ONE),
68     KILOGRAM_PER_CUBIC_METRE(0x2715, "org.bluetooth.unit.density.kilogram_per_cubic_metre",
69             Units.KILOGRAM_PER_CUBICMETRE),
70     KILOGRAM_PER_SQUARE_METRE(0x2716, "org.bluetooth.unit.surface_density.kilogram_per_square_metre",
71             BUnits.KILOGRAM_PER_SQUARE_METER),
72     CUBIC_METRE_PER_KILOGRAM(0x2717, "org.bluetooth.unit.specific_volume.cubic_metre_per_kilogram", Units.ONE),
73     AMPERE_PER_SQUARE_METRE(0x2718, "org.bluetooth.unit.current_density.ampere_per_square_metre", Units.ONE),
74     AMPERE_PER_METRE(0x2719, "org.bluetooth.unit.magnetic_field_strength.ampere_per_metre", Units.ONE),
75     MOLE_PER_CUBIC_METRE(0x271A, "org.bluetooth.unit.amount_concentration.mole_per_cubic_metre", Units.ONE),
76     CONCENTRATION_KILOGRAM_PER_CUBIC_METRE(0x271B, "org.bluetooth.unit.mass_concentration.kilogram_per_cubic_metre",
77             Units.KILOGRAM_PER_CUBICMETRE),
78     CANDELA_PER_SQUARE_METRE(0x271C, "org.bluetooth.unit.luminance.candela_per_square_metre", Units.ONE),
79     REFRACTIVE_INDEX(0x271D, "org.bluetooth.unit.refractive_index", Units.ONE),
80     RELATIVE_PERMEABILITY(0x271E, "org.bluetooth.unit.relative_permeability", Units.ONE),
81     RADIAN(0x2720, "org.bluetooth.unit.plane_angle.radian", Units.RADIAN),
82     STERADIAN(0x2721, "org.bluetooth.unit.solid_angle.steradian", Units.STERADIAN),
83     HERTZ(0x2722, "org.bluetooth.unit.frequency.hertz", Units.HERTZ),
84     NEWTON(0x2723, "org.bluetooth.unit.force.newton", Units.NEWTON),
85     PASCAL(0x2724, "org.bluetooth.unit.pressure.pascal", SIUnits.PASCAL),
86     JOULE(0x2725, "org.bluetooth.unit.energy.joule", Units.JOULE),
87     WATT(0x2726, "org.bluetooth.unit.power.watt", Units.WATT),
88     COULOMB(0x2727, "org.bluetooth.unit.electric_charge.coulomb", Units.COULOMB),
89     VOLT(0x2728, "org.bluetooth.unit.electric_potential_difference.volt", Units.VOLT),
90     FARAD(0x2729, "org.bluetooth.unit.capacitance.farad", Units.FARAD),
91     OHM(0x272A, "org.bluetooth.unit.electric_resistance.ohm", Units.OHM),
92     SIEMENS(0x272B, "org.bluetooth.unit.electric_conductance.siemens", Units.SIEMENS),
93     WEBER(0x272C, "org.bluetooth.unit.magnetic_flux.weber", Units.WEBER),
94     TESLA(0x272D, "org.bluetooth.unit.magnetic_flux_density.tesla", Units.TESLA),
95     HENRY(0x272E, "org.bluetooth.unit.inductance.henry", Units.HENRY),
96     DEGREE_CELSIUS(0x272F, "org.bluetooth.unit.thermodynamic_temperature.degree_celsius", SIUnits.CELSIUS),
97     LUMEN(0x2730, "org.bluetooth.unit.luminous_flux.lumen", Units.LUMEN),
98     LUX(0x2731, "org.bluetooth.unit.illuminance.lux", Units.LUX),
99     BECQUEREL(0x2732, "org.bluetooth.unit.activity_referred_to_a_radionuclide.becquerel", Units.BECQUEREL),
100     GRAY(0x2733, "org.bluetooth.unit.absorbed_dose.gray", Units.GRAY),
101     SIEVERT(0x2734, "org.bluetooth.unit.dose_equivalent.sievert", Units.SIEVERT),
102     KATAL(0x2735, "org.bluetooth.unit.catalytic_activity.katal", Units.KATAL),
103     PASCAL_SECOND(0x2740, "org.bluetooth.unit.dynamic_viscosity.pascal_second", Units.ONE),
104     NEWTON_METRE(0x2741, "org.bluetooth.unit.moment_of_force.newton_metre", Units.ONE),
105     NEWTON_PER_METRE(0x2742, "org.bluetooth.unit.surface_tension.newton_per_metre", Units.ONE),
106     RADIAN_PER_SECOND(0x2743, "org.bluetooth.unit.angular_velocity.radian_per_second", Units.ONE),
107     RADIAN_PER_SECOND_SQUARED(0x2744, "org.bluetooth.unit.angular_acceleration.radian_per_second_squared", Units.ONE),
108     FLUX_WATT_PER_SQUARE_METRE(0x2745, "org.bluetooth.unit.heat_flux_density.watt_per_square_metre", Units.ONE),
109     JOULE_PER_KELVIN(0x2746, "org.bluetooth.unit.heat_capacity.joule_per_kelvin", Units.ONE),
110     JOULE_PER_KILOGRAM_KELVIN(0x2747, "org.bluetooth.unit.specific_heat_capacity.joule_per_kilogram_kelvin", Units.ONE),
111     JOULE_PER_KILOGRAM(0x2748, "org.bluetooth.unit.specific_energy.joule_per_kilogram", Units.ONE),
112     WATT_PER_METRE_KELVIN(0x2749, "org.bluetooth.unit.thermal_conductivity.watt_per_metre_kelvin", Units.ONE),
113     JOULE_PER_CUBIC_METRE(0x274A, "org.bluetooth.unit.energy_density.joule_per_cubic_metre", Units.ONE),
114     VOLT_PER_METRE(0x274B, "org.bluetooth.unit.electric_field_strength.volt_per_metre", Units.ONE),
115     CHARGE_DENSITY_COULOMB_PER_CUBIC_METRE(0x274C, "org.bluetooth.unit.electric_charge_density.coulomb_per_cubic_metre",
116             Units.ONE),
117     CHARGE_DENSITY_COULOMB_PER_SQUARE_METRE(0x274D,
118             "org.bluetooth.unit.surface_charge_density.coulomb_per_square_metre", Units.ONE),
119     FLUX_DENSITY_COULOMB_PER_SQUARE_METRE(0x274E, "org.bluetooth.unit.electric_flux_density.coulomb_per_square_metre",
120             Units.ONE),
121     FARAD_PER_METRE(0x274F, "org.bluetooth.unit.permittivity.farad_per_metre", Units.ONE),
122     HENRY_PER_METRE(0x2750, "org.bluetooth.unit.permeability.henry_per_metre", Units.ONE),
123     JOULE_PER_MOLE(0x2751, "org.bluetooth.unit.molar_energy.joule_per_mole", Units.ONE),
124     JOULE_PER_MOLE_KELVIN(0x2752, "org.bluetooth.unit.molar_entropy.joule_per_mole_kelvin", Units.ONE),
125     COULOMB_PER_KILOGRAM(0x2753, "org.bluetooth.unit.exposure.coulomb_per_kilogram", Units.ONE),
126     GRAY_PER_SECOND(0x2754, "org.bluetooth.unit.absorbed_dose_rate.gray_per_second", BUnits.GRAY_PER_SECOND),
127     WATT_PER_STERADIAN(0x2755, "org.bluetooth.unit.radiant_intensity.watt_per_steradian", BUnits.WATT_PER_STERADIAN),
128     WATT_PER_STERADIAN_PER_SQUARE_METRE(0x2756, "org.bluetooth.unit.radiance.watt_per_square_metre_steradian",
129             BUnits.WATT_PER_STERADIAN_PER_SQUARE_METRE),
130     KATAL_PER_CUBIC_METRE(0x2757, "org.bluetooth.unit.catalytic_activity_concentration.katal_per_cubic_metre",
131             Units.ONE),
132     MINUTE(0x2760, "org.bluetooth.unit.time.minute", Units.MINUTE),
133     HOUR(0x2761, "org.bluetooth.unit.time.hour", Units.HOUR),
134     DAY(0x2762, "org.bluetooth.unit.time.day", Units.DAY),
135     ANGLE_DEGREE(0x2763, "org.bluetooth.unit.plane_angle.degree", Units.DEGREE_ANGLE),
136     ANGLE_MINUTE(0x2764, "org.bluetooth.unit.plane_angle.minute", BUnits.MINUTE_ANGLE),
137     ANGLE_SECOND(0x2765, "org.bluetooth.unit.plane_angle.second", BUnits.SECOND_ANGLE),
138     HECTARE(0x2766, "org.bluetooth.unit.area.hectare", BUnits.HECTARE),
139     LITRE(0x2767, "org.bluetooth.unit.volume.litre", Units.LITRE),
140     TONNE(0x2768, "org.bluetooth.unit.mass.tonne", MetricPrefix.KILO(SIUnits.KILOGRAM)),
141     BAR(0x2780, "org.bluetooth.unit.pressure.bar", Units.BAR),
142     MILLIMETRE_OF_MERCURY(0x2781, "org.bluetooth.unit.pressure.millimetre_of_mercury", Units.MILLIMETRE_OF_MERCURY),
143     ÅNGSTRÖM(0x2782, "org.bluetooth.unit.length.ångström", Units.ONE),
144     NAUTICAL_MILE(0x2783, "org.bluetooth.unit.length.nautical_mile", BUnits.NAUTICAL_MILE),
145     BARN(0x2784, "org.bluetooth.unit.area.barn", BUnits.BARN),
146     KNOT(0x2785, "org.bluetooth.unit.velocity.knot", Units.KNOT),
147     NEPER(0x2786, "org.bluetooth.unit.logarithmic_radio_quantity.neper", Units.ONE),
148     BEL(0x2787, "org.bluetooth.unit.logarithmic_radio_quantity.bel", Units.ONE),
149     YARD(0x27A0, "org.bluetooth.unit.length.yard", ImperialUnits.YARD),
150     PARSEC(0x27A1, "org.bluetooth.unit.length.parsec", Units.ONE),
151     INCH(0x27A2, "org.bluetooth.unit.length.inch", ImperialUnits.INCH),
152     FOOT(0x27A3, "org.bluetooth.unit.length.foot", ImperialUnits.FOOT),
153     MILE(0x27A4, "org.bluetooth.unit.length.mile", ImperialUnits.MILE),
154     POUND_FORCE_PER_SQUARE_INCH(0x27A5, "org.bluetooth.unit.pressure.pound_force_per_square_inch", Units.ONE),
155     KILOMETRE_PER_HOUR(0x27A6, "org.bluetooth.unit.velocity.kilometre_per_hour", SIUnits.KILOMETRE_PER_HOUR),
156     MILES_PER_HOUR(0x27A7, "org.bluetooth.unit.velocity.mile_per_hour", ImperialUnits.MILES_PER_HOUR),
157     REVOLUTION_PER_MINUTE(0x27A8, "org.bluetooth.unit.angular_velocity.revolution_per_minute",
158             BUnits.REVOLUTION_PER_MINUTE),
159     GRAM_CALORIE(0x27A9, "org.bluetooth.unit.energy.gram_calorie", Units.ONE),
160     KILOGRAM_CALORIE(0x27AA, "org.bluetooth.unit.energy.kilogram_calorie", Units.ONE),
161     KILOWATT_HOUR(0x27AB, "org.bluetooth.unit.energy.kilowatt_hour", Units.KILOWATT_HOUR),
162     DEGREE_FAHRENHEIT(0x27AC, "org.bluetooth.unit.thermodynamic_temperature.degree_fahrenheit",
163             ImperialUnits.FAHRENHEIT),
164     PERCENTAGE(0x27AD, "org.bluetooth.unit.percentage", Units.PERCENT),
165     PER_MILLE(0x27AE, "org.bluetooth.unit.per_mille", Units.ONE),
166     BEATS_PER_MINUTE(0x27AF, "org.bluetooth.unit.period.beats_per_minute", BUnits.BEATS_PER_MINUTE),
167     AMPERE_HOURS(0x27B0, "org.bluetooth.unit.electric_charge.ampere_hours", BUnits.AMPERE_HOUR),
168     MILLIGRAM_PER_DECILITRE(0x27B1, "org.bluetooth.unit.mass_density.milligram_per_decilitre", Units.ONE),
169     MILLIMOLE_PER_LITRE(0x27B2, "org.bluetooth.unit.mass_density.millimole_per_litre", Units.ONE),
170     YEAR(0x27B3, "org.bluetooth.unit.time.year", Units.YEAR),
171     MONTH(0x27B4, "org.bluetooth.unit.time.month", Units.ONE),
172     COUNT_PER_CUBIC_METRE(0x27B5, "org.bluetooth.unit.concentration.count_per_cubic_metre", Units.ONE),
173     WATT_PER_SQUARE_METRE(0x27B6, "org.bluetooth.unit.irradiance.watt_per_square_metre", Units.IRRADIANCE),
174     MILLILITER_PER_KILOGRAM_PER_MINUTE(0x27B7, "org.bluetooth.unit.transfer_rate.milliliter_per_kilogram_per_minute",
175             Units.ONE),
176     POUND(0x27B8, "org.bluetooth.unit.mass.pound", BUnits.POUND),
177     METABOLIC_EQUIVALENT(0x27B9, "org.bluetooth.unit.metabolic_equivalent", Units.ONE),
178     STEP_PER_MINUTE(0x27BA, "org.bluetooth.unit.step_per_minute", BUnits.STEP_PER_MINUTE),
179     STROKE_PER_MINUTE(0x27BC, "org.bluetooth.unit.stroke_per_minute", BUnits.STROKE_PER_MINUTE),
180     KILOMETER_PER_MINUTE(0x27BD, "org.bluetooth.unit.velocity.kilometer_per_minute", BUnits.KILOMETRE_PER_MINUTE),
181     LUMEN_PER_WATT(0x27BE, "org.bluetooth.unit.luminous_efficacy.lumen_per_watt", BUnits.LUMEN_PER_WATT),
182     LUMEN_HOUR(0x27BF, "org.bluetooth.unit.luminous_energy.lumen_hour", BUnits.LUMEN_HOUR),
183     LUX_HOUR(0x27C0, "org.bluetooth.unit.luminous_exposure.lux_hour", BUnits.LUX_HOUR),
184     GRAM_PER_SECOND(0x27C1, "org.bluetooth.unit.mass_flow.gram_per_second", BUnits.GRAM_PER_SECOND),
185     LITRE_PER_SECOND(0x27C2, "org.bluetooth.unit.volume_flow.litre_per_second", BUnits.LITRE_PER_SECOND),
186     DECIBEL_SPL(0x27C3, "org.bluetooth.unit.sound_pressure.decibel_spl", Units.ONE),
187     PARTS_PER_MILLION(0x27C4, "org.bluetooth.unit.concentration.parts_per_million", Units.PARTS_PER_MILLION),
188     PARTS_PER_BILLION(0x27C5, "org.bluetooth.unit.concentration.parts_per_billion", Units.PARTS_PER_BILLION);
189
190     private UUID uuid;
191
192     private String type;
193
194     private Unit<?> unit;
195
196     private BluetoothUnit(long key, String type, Unit<?> unit) {
197         this.uuid = new UUID((key << 32) | 0x1000, BluetoothBindingConstants.BLUETOOTH_BASE_UUID);
198         this.type = type;
199         this.unit = unit;
200     }
201
202     public static @Nullable BluetoothUnit findByType(String type) {
203         for (BluetoothUnit unit : BluetoothUnit.values()) {
204             if (unit.type.equals(type)) {
205                 return unit;
206             }
207         }
208         return null;
209     }
210
211     public UUID getUUID() {
212         return uuid;
213     }
214
215     public String getType() {
216         return type;
217     }
218
219     public Unit<?> getUnit() {
220         return unit;
221     }
222
223     /**
224      * This class contains the set of units that are not yet defined in Units.
225      * Once these units are added to the core then this class will be removed.
226      *
227      * @author cpetty
228      * @deprecated
229      */
230     @Deprecated
231     public static class BUnits {
232         public static final Unit<ArealDensity> KILOGRAM_PER_SQUARE_METER = addUnit(
233                 new ProductUnit<ArealDensity>(SIUnits.KILOGRAM.divide(SIUnits.SQUARE_METRE)));
234
235         public static final Unit<RadiationExposure> COULOMB_PER_KILOGRAM = addUnit(
236                 new ProductUnit<RadiationExposure>(Units.COULOMB.divide(SIUnits.KILOGRAM)));
237
238         public static final Unit<RadiationDoseAbsorptionRate> GRAY_PER_SECOND = addUnit(
239                 new ProductUnit<RadiationDoseAbsorptionRate>(Units.GRAY.divide(Units.SECOND)));
240
241         public static final Unit<Mass> POUND = addUnit(
242                 new TransformedUnit<Mass>(SIUnits.KILOGRAM, new MultiplyConverter(0.45359237)));
243
244         public static final Unit<Angle> MINUTE_ANGLE = addUnit(new TransformedUnit<Angle>(Units.RADIAN,
245                 new PiMultiplierConverter().concatenate(new RationalConverter(1, 180 * 60))));
246
247         public static final Unit<Angle> SECOND_ANGLE = addUnit(new TransformedUnit<Angle>(Units.RADIAN,
248                 new PiMultiplierConverter().concatenate(new RationalConverter(1, 180 * 60 * 60))));
249
250         public static final Unit<Area> HECTARE = addUnit(SIUnits.SQUARE_METRE.multiply(10000.0));
251         public static final Unit<Area> BARN = addUnit(SIUnits.SQUARE_METRE.multiply(10E-28));
252
253         public static final Unit<Length> NAUTICAL_MILE = addUnit(SIUnits.METRE.multiply(1852.0));
254
255         public static final Unit<RadiantIntensity> WATT_PER_STERADIAN = addUnit(
256                 new ProductUnit<RadiantIntensity>(Units.WATT.divide(Units.STERADIAN)));
257
258         public static final Unit<Radiance> WATT_PER_STERADIAN_PER_SQUARE_METRE = addUnit(
259                 new ProductUnit<Radiance>(WATT_PER_STERADIAN.divide(SIUnits.SQUARE_METRE)));
260
261         public static final Unit<Frequency> CYCLES_PER_MINUTE = addUnit(new TransformedUnit<Frequency>(Units.HERTZ,
262                 new RationalConverter(BigInteger.valueOf(60), BigInteger.ONE)));
263
264         public static final Unit<Angle> REVOLUTION = addUnit(new TransformedUnit<Angle>(Units.RADIAN,
265                 new PiMultiplierConverter().concatenate(new RationalConverter(2, 1))));
266         public static final Unit<AngularVelocity> REVOLUTION_PER_MINUTE = addUnit(
267                 new ProductUnit<AngularVelocity>(REVOLUTION.divide(Units.MINUTE)));
268
269         public static final Unit<Dimensionless> STEPS = addUnit(Units.ONE.alternate("steps"));
270         public static final Unit<Dimensionless> BEATS = addUnit(Units.ONE.alternate("beats"));
271         public static final Unit<Dimensionless> STROKE = addUnit(Units.ONE.alternate("stroke"));
272
273         public static final Unit<Frequency> STEP_PER_MINUTE = addUnit(
274                 new ProductUnit<Frequency>(STEPS.divide(Units.MINUTE)));
275
276         public static final Unit<Frequency> BEATS_PER_MINUTE = addUnit(
277                 new ProductUnit<Frequency>(BEATS.divide(Units.MINUTE)));
278
279         public static final Unit<Frequency> STROKE_PER_MINUTE = addUnit(
280                 new ProductUnit<Frequency>(STROKE.divide(Units.MINUTE)));
281
282         public static final Unit<MassFlowRate> GRAM_PER_SECOND = addUnit(
283                 new ProductUnit<MassFlowRate>(SIUnits.GRAM.divide(Units.SECOND)));
284
285         public static final Unit<LuminousEfficacy> LUMEN_PER_WATT = addUnit(
286                 new ProductUnit<LuminousEfficacy>(Units.LUMEN.divide(Units.WATT)));
287
288         public static final Unit<LuminousEnergy> LUMEN_SECOND = addUnit(
289                 new ProductUnit<LuminousEnergy>(Units.LUMEN.multiply(Units.SECOND)));
290
291         public static final Unit<LuminousEnergy> LUMEN_HOUR = addUnit(
292                 new ProductUnit<LuminousEnergy>(Units.LUMEN.multiply(Units.HOUR)));
293
294         public static final Unit<ElectricCharge> AMPERE_HOUR = addUnit(
295                 new ProductUnit<ElectricCharge>(Units.AMPERE.multiply(Units.HOUR)));
296
297         public static final Unit<LuminousExposure> LUX_HOUR = addUnit(
298                 new ProductUnit<LuminousExposure>(Units.LUX.multiply(Units.HOUR)));
299
300         public static final Unit<Speed> KILOMETRE_PER_MINUTE = addUnit(SIUnits.KILOMETRE_PER_HOUR.multiply(60.0));
301
302         public static final Unit<VolumetricFlowRate> LITRE_PER_SECOND = addUnit(
303                 new ProductUnit<VolumetricFlowRate>(Units.LITRE.divide(Units.SECOND)));
304
305         static {
306             SimpleUnitFormat.getInstance().label(GRAY_PER_SECOND, "Gy/s");
307             SimpleUnitFormat.getInstance().label(MINUTE_ANGLE, "'");
308             SimpleUnitFormat.getInstance().label(SECOND_ANGLE, "\"");
309             SimpleUnitFormat.getInstance().label(HECTARE, "ha");
310             SimpleUnitFormat.getInstance().label(NAUTICAL_MILE, "NM");
311             SimpleUnitFormat.getInstance().label(KILOGRAM_PER_SQUARE_METER, "kg/m²");
312             SimpleUnitFormat.getInstance().label(POUND, "lb");
313             SimpleUnitFormat.getInstance().label(CYCLES_PER_MINUTE, "cpm");
314             SimpleUnitFormat.getInstance().label(GRAM_PER_SECOND, "g/s");
315             SimpleUnitFormat.getInstance().label(LUMEN_SECOND, "lm·s");
316             SimpleUnitFormat.getInstance().label(LUMEN_HOUR, "lm·h");
317             SimpleUnitFormat.getInstance().label(LUMEN_PER_WATT, "lm/W");
318             SimpleUnitFormat.getInstance().label(LUX_HOUR, "lx·h");
319             SimpleUnitFormat.getInstance().label(KILOMETRE_PER_MINUTE, "km/min");
320             SimpleUnitFormat.getInstance().label(LITRE_PER_SECOND, "l/s");
321             SimpleUnitFormat.getInstance().label(BEATS_PER_MINUTE, "bpm");
322             SimpleUnitFormat.getInstance().label(STEP_PER_MINUTE, "steps/min");
323             SimpleUnitFormat.getInstance().label(STROKE_PER_MINUTE, "spm");
324             SimpleUnitFormat.getInstance().label(REVOLUTION_PER_MINUTE, "rpm");
325         }
326
327         private static <U extends Unit<?>> U addUnit(U unit) {
328             return unit;
329         }
330
331         public interface AngularVelocity extends Quantity<AngularVelocity> {
332         }
333
334         public interface LuminousEnergy extends Quantity<LuminousEnergy> {
335         }
336
337         public interface LuminousEfficacy extends Quantity<LuminousEfficacy> {
338         }
339
340         public interface LuminousExposure extends Quantity<LuminousExposure> {
341         }
342
343         public interface RadiantIntensity extends Quantity<RadiantIntensity> {
344         }
345
346         public interface Radiance extends Quantity<Radiance> {
347         }
348
349         public interface RadiationExposure extends Quantity<RadiationExposure> {
350         }
351
352         public interface RadiationDoseAbsorptionRate extends Quantity<RadiationDoseAbsorptionRate> {
353         }
354
355         public interface MassFlowRate extends Quantity<MassFlowRate> {
356         }
357     }
358 }