001// Copyright (c) FIRST and other WPILib contributors.
002// Open Source Software; you can modify and/or share it under the terms of
003// the WPILib BSD license file in the root directory of this project.
004
005// THIS FILE WAS AUTO-GENERATED BY ./wpiunits/generate_units.py. DO NOT MODIFY
006
007package edu.wpi.first.units.measure;
008
009import static edu.wpi.first.units.Units.*;
010import edu.wpi.first.units.*;
011
012@SuppressWarnings({"unchecked", "cast", "checkstyle", "PMD"})
013public interface Per<Dividend extends Unit, Divisor extends Unit> extends Measure<PerUnit<Dividend, Divisor>> {
014  static <Dividend extends Unit, Divisor extends Unit> Per<Dividend, Divisor> ofRelativeUnits(double magnitude, PerUnit<Dividend, Divisor> unit) {
015    return new ImmutablePer<Dividend, Divisor>(magnitude, unit.toBaseUnits(magnitude), unit);
016  }
017
018  static <Dividend extends Unit, Divisor extends Unit> Per<Dividend, Divisor> ofBaseUnits(double baseUnitMagnitude, PerUnit<Dividend, Divisor> unit) {
019    return new ImmutablePer<Dividend, Divisor>(unit.fromBaseUnits(baseUnitMagnitude), baseUnitMagnitude, unit);
020  }
021
022  @Override
023  Per<Dividend, Divisor> copy();
024
025  @Override
026  default MutPer<Dividend, Divisor> mutableCopy() {
027    return new MutPer<Dividend, Divisor>(magnitude(), baseUnitMagnitude(), unit());
028  }
029
030  @Override
031  PerUnit<Dividend, Divisor> unit();
032
033  @Override
034  default PerUnit<Dividend, Divisor> baseUnit() { return (PerUnit<Dividend, Divisor>) unit().getBaseUnit(); }
035
036  @Override
037  default double in(PerUnit<Dividend, Divisor> unit) {
038    return unit.fromBaseUnits(baseUnitMagnitude());
039  }
040
041  @Override
042  default Per<Dividend, Divisor> unaryMinus() {
043    return (Per<Dividend, Divisor>) unit().ofBaseUnits(0 - baseUnitMagnitude());
044  }
045
046  /**
047  * {@inheritDoc}
048  *
049  * @deprecated use unaryMinus() instead. This was renamed for consistency with other WPILib classes like Rotation2d
050  */
051  @Override
052  @Deprecated(since = "2025", forRemoval = true)
053  @SuppressWarnings({"deprecation", "removal"})
054  default Per<Dividend, Divisor> negate() {
055    return (Per<Dividend, Divisor>) unaryMinus();
056  }
057
058  @Override
059  default Per<Dividend, Divisor> plus(Measure<? extends PerUnit<Dividend, Divisor>> other) {
060    return (Per<Dividend, Divisor>) unit().ofBaseUnits(baseUnitMagnitude() + other.baseUnitMagnitude());
061  }
062
063  @Override
064  default Per<Dividend, Divisor> minus(Measure<? extends PerUnit<Dividend, Divisor>> other) {
065    return (Per<Dividend, Divisor>) unit().ofBaseUnits(baseUnitMagnitude() - other.baseUnitMagnitude());
066  }
067
068  @Override
069  default Per<Dividend, Divisor> times(double multiplier) {
070    return (Per<Dividend, Divisor>) unit().ofBaseUnits(baseUnitMagnitude() * multiplier);
071  }
072
073  @Override
074  default Per<Dividend, Divisor> div(double divisor) {
075    return (Per<Dividend, Divisor>) unit().ofBaseUnits(baseUnitMagnitude() / divisor);
076  }
077
078  /**
079  * {@inheritDoc}
080  *
081  * @deprecated use div instead. This was renamed for consistency with other languages like Kotlin
082  */
083  @Override
084  @Deprecated(since = "2025", forRemoval = true)
085  @SuppressWarnings({"deprecation", "removal"})
086  default Per<Dividend, Divisor> divide(double divisor) {
087    return (Per<Dividend, Divisor>) div(divisor);
088  }
089
090  @Override
091  default Velocity<PerUnit<Dividend, Divisor>> per(TimeUnit period) {
092    return div(period.of(1));
093  }
094
095
096  @Override
097  default Mult<PerUnit<Dividend, Divisor>, AccelerationUnit<?>> times(Acceleration<?> multiplier) {
098    return (Mult<PerUnit<Dividend, Divisor>, AccelerationUnit<?>>) Measure.super.times(multiplier);
099  }
100
101  @Override
102  default Per<PerUnit<Dividend, Divisor>, AccelerationUnit<?>> div(Acceleration<?> divisor) {
103    return (Per<PerUnit<Dividend, Divisor>, AccelerationUnit<?>>) Measure.super.div(divisor);
104  }
105
106  /**
107  * {@inheritDoc}
108  *
109  * @deprecated use div instead. This was renamed for consistency with other languages like Kotlin
110  */
111  @Deprecated(since = "2025", forRemoval = true)
112  @SuppressWarnings({"deprecation", "removal"})
113  @Override
114  default Per<PerUnit<Dividend, Divisor>, AccelerationUnit<?>> divide(Acceleration<?> divisor) {
115    return div(divisor);
116  }
117
118
119  @Override
120  default Mult<PerUnit<Dividend, Divisor>, AngleUnit> times(Angle multiplier) {
121    return (Mult<PerUnit<Dividend, Divisor>, AngleUnit>) Measure.super.times(multiplier);
122  }
123
124  @Override
125  default Per<PerUnit<Dividend, Divisor>, AngleUnit> div(Angle divisor) {
126    return (Per<PerUnit<Dividend, Divisor>, AngleUnit>) Measure.super.div(divisor);
127  }
128
129  /**
130  * {@inheritDoc}
131  *
132  * @deprecated use div instead. This was renamed for consistency with other languages like Kotlin
133  */
134  @Deprecated(since = "2025", forRemoval = true)
135  @SuppressWarnings({"deprecation", "removal"})
136  @Override
137  default Per<PerUnit<Dividend, Divisor>, AngleUnit> divide(Angle divisor) {
138    return div(divisor);
139  }
140
141
142  @Override
143  default Mult<PerUnit<Dividend, Divisor>, AngularAccelerationUnit> times(AngularAcceleration multiplier) {
144    return (Mult<PerUnit<Dividend, Divisor>, AngularAccelerationUnit>) Measure.super.times(multiplier);
145  }
146
147  @Override
148  default Per<PerUnit<Dividend, Divisor>, AngularAccelerationUnit> div(AngularAcceleration divisor) {
149    return (Per<PerUnit<Dividend, Divisor>, AngularAccelerationUnit>) Measure.super.div(divisor);
150  }
151
152  /**
153  * {@inheritDoc}
154  *
155  * @deprecated use div instead. This was renamed for consistency with other languages like Kotlin
156  */
157  @Deprecated(since = "2025", forRemoval = true)
158  @SuppressWarnings({"deprecation", "removal"})
159  @Override
160  default Per<PerUnit<Dividend, Divisor>, AngularAccelerationUnit> divide(AngularAcceleration divisor) {
161    return div(divisor);
162  }
163
164
165  @Override
166  default Mult<PerUnit<Dividend, Divisor>, AngularMomentumUnit> times(AngularMomentum multiplier) {
167    return (Mult<PerUnit<Dividend, Divisor>, AngularMomentumUnit>) Measure.super.times(multiplier);
168  }
169
170  @Override
171  default Per<PerUnit<Dividend, Divisor>, AngularMomentumUnit> div(AngularMomentum divisor) {
172    return (Per<PerUnit<Dividend, Divisor>, AngularMomentumUnit>) Measure.super.div(divisor);
173  }
174
175  /**
176  * {@inheritDoc}
177  *
178  * @deprecated use div instead. This was renamed for consistency with other languages like Kotlin
179  */
180  @Deprecated(since = "2025", forRemoval = true)
181  @SuppressWarnings({"deprecation", "removal"})
182  @Override
183  default Per<PerUnit<Dividend, Divisor>, AngularMomentumUnit> divide(AngularMomentum divisor) {
184    return div(divisor);
185  }
186
187
188  @Override
189  default Mult<PerUnit<Dividend, Divisor>, AngularVelocityUnit> times(AngularVelocity multiplier) {
190    return (Mult<PerUnit<Dividend, Divisor>, AngularVelocityUnit>) Measure.super.times(multiplier);
191  }
192
193  @Override
194  default Per<PerUnit<Dividend, Divisor>, AngularVelocityUnit> div(AngularVelocity divisor) {
195    return (Per<PerUnit<Dividend, Divisor>, AngularVelocityUnit>) Measure.super.div(divisor);
196  }
197
198  /**
199  * {@inheritDoc}
200  *
201  * @deprecated use div instead. This was renamed for consistency with other languages like Kotlin
202  */
203  @Deprecated(since = "2025", forRemoval = true)
204  @SuppressWarnings({"deprecation", "removal"})
205  @Override
206  default Per<PerUnit<Dividend, Divisor>, AngularVelocityUnit> divide(AngularVelocity divisor) {
207    return div(divisor);
208  }
209
210
211  @Override
212  default Mult<PerUnit<Dividend, Divisor>, CurrentUnit> times(Current multiplier) {
213    return (Mult<PerUnit<Dividend, Divisor>, CurrentUnit>) Measure.super.times(multiplier);
214  }
215
216  @Override
217  default Per<PerUnit<Dividend, Divisor>, CurrentUnit> div(Current divisor) {
218    return (Per<PerUnit<Dividend, Divisor>, CurrentUnit>) Measure.super.div(divisor);
219  }
220
221  /**
222  * {@inheritDoc}
223  *
224  * @deprecated use div instead. This was renamed for consistency with other languages like Kotlin
225  */
226  @Deprecated(since = "2025", forRemoval = true)
227  @SuppressWarnings({"deprecation", "removal"})
228  @Override
229  default Per<PerUnit<Dividend, Divisor>, CurrentUnit> divide(Current divisor) {
230    return div(divisor);
231  }
232
233  @Override
234  default Per<Dividend, Divisor> div(Dimensionless divisor) {
235    return (Per<Dividend, Divisor>) unit().of(baseUnitMagnitude() / divisor.baseUnitMagnitude());
236  }
237
238  /**
239  * {@inheritDoc}
240  *
241  * @deprecated use div instead. This was renamed for consistency with other languages like Kotlin
242  */
243  @Override
244  @Deprecated(since = "2025", forRemoval = true)
245  @SuppressWarnings({"deprecation", "removal"})
246  default Per<Dividend, Divisor> divide(Dimensionless divisor) {
247    return (Per<Dividend, Divisor>) div(divisor);
248  }
249
250  @Override
251  default Per<Dividend, Divisor> times(Dimensionless multiplier) {
252    return (Per<Dividend, Divisor>) unit().of(baseUnitMagnitude() * multiplier.baseUnitMagnitude());
253  }
254
255
256  @Override
257  default Mult<PerUnit<Dividend, Divisor>, DistanceUnit> times(Distance multiplier) {
258    return (Mult<PerUnit<Dividend, Divisor>, DistanceUnit>) Measure.super.times(multiplier);
259  }
260
261  @Override
262  default Per<PerUnit<Dividend, Divisor>, DistanceUnit> div(Distance divisor) {
263    return (Per<PerUnit<Dividend, Divisor>, DistanceUnit>) Measure.super.div(divisor);
264  }
265
266  /**
267  * {@inheritDoc}
268  *
269  * @deprecated use div instead. This was renamed for consistency with other languages like Kotlin
270  */
271  @Deprecated(since = "2025", forRemoval = true)
272  @SuppressWarnings({"deprecation", "removal"})
273  @Override
274  default Per<PerUnit<Dividend, Divisor>, DistanceUnit> divide(Distance divisor) {
275    return div(divisor);
276  }
277
278
279  @Override
280  default Mult<PerUnit<Dividend, Divisor>, EnergyUnit> times(Energy multiplier) {
281    return (Mult<PerUnit<Dividend, Divisor>, EnergyUnit>) Measure.super.times(multiplier);
282  }
283
284  @Override
285  default Per<PerUnit<Dividend, Divisor>, EnergyUnit> div(Energy divisor) {
286    return (Per<PerUnit<Dividend, Divisor>, EnergyUnit>) Measure.super.div(divisor);
287  }
288
289  /**
290  * {@inheritDoc}
291  *
292  * @deprecated use div instead. This was renamed for consistency with other languages like Kotlin
293  */
294  @Deprecated(since = "2025", forRemoval = true)
295  @SuppressWarnings({"deprecation", "removal"})
296  @Override
297  default Per<PerUnit<Dividend, Divisor>, EnergyUnit> divide(Energy divisor) {
298    return div(divisor);
299  }
300
301
302  @Override
303  default Mult<PerUnit<Dividend, Divisor>, ForceUnit> times(Force multiplier) {
304    return (Mult<PerUnit<Dividend, Divisor>, ForceUnit>) Measure.super.times(multiplier);
305  }
306
307  @Override
308  default Per<PerUnit<Dividend, Divisor>, ForceUnit> div(Force divisor) {
309    return (Per<PerUnit<Dividend, Divisor>, ForceUnit>) Measure.super.div(divisor);
310  }
311
312  /**
313  * {@inheritDoc}
314  *
315  * @deprecated use div instead. This was renamed for consistency with other languages like Kotlin
316  */
317  @Deprecated(since = "2025", forRemoval = true)
318  @SuppressWarnings({"deprecation", "removal"})
319  @Override
320  default Per<PerUnit<Dividend, Divisor>, ForceUnit> divide(Force divisor) {
321    return div(divisor);
322  }
323
324
325  @Override
326  default Mult<PerUnit<Dividend, Divisor>, FrequencyUnit> times(Frequency multiplier) {
327    return (Mult<PerUnit<Dividend, Divisor>, FrequencyUnit>) Measure.super.times(multiplier);
328  }
329
330  @Override
331  default Per<PerUnit<Dividend, Divisor>, FrequencyUnit> div(Frequency divisor) {
332    return (Per<PerUnit<Dividend, Divisor>, FrequencyUnit>) Measure.super.div(divisor);
333  }
334
335  /**
336  * {@inheritDoc}
337  *
338  * @deprecated use div instead. This was renamed for consistency with other languages like Kotlin
339  */
340  @Deprecated(since = "2025", forRemoval = true)
341  @SuppressWarnings({"deprecation", "removal"})
342  @Override
343  default Per<PerUnit<Dividend, Divisor>, FrequencyUnit> divide(Frequency divisor) {
344    return div(divisor);
345  }
346
347
348  @Override
349  default Mult<PerUnit<Dividend, Divisor>, LinearAccelerationUnit> times(LinearAcceleration multiplier) {
350    return (Mult<PerUnit<Dividend, Divisor>, LinearAccelerationUnit>) Measure.super.times(multiplier);
351  }
352
353  @Override
354  default Per<PerUnit<Dividend, Divisor>, LinearAccelerationUnit> div(LinearAcceleration divisor) {
355    return (Per<PerUnit<Dividend, Divisor>, LinearAccelerationUnit>) Measure.super.div(divisor);
356  }
357
358  /**
359  * {@inheritDoc}
360  *
361  * @deprecated use div instead. This was renamed for consistency with other languages like Kotlin
362  */
363  @Deprecated(since = "2025", forRemoval = true)
364  @SuppressWarnings({"deprecation", "removal"})
365  @Override
366  default Per<PerUnit<Dividend, Divisor>, LinearAccelerationUnit> divide(LinearAcceleration divisor) {
367    return div(divisor);
368  }
369
370
371  @Override
372  default Mult<PerUnit<Dividend, Divisor>, LinearMomentumUnit> times(LinearMomentum multiplier) {
373    return (Mult<PerUnit<Dividend, Divisor>, LinearMomentumUnit>) Measure.super.times(multiplier);
374  }
375
376  @Override
377  default Per<PerUnit<Dividend, Divisor>, LinearMomentumUnit> div(LinearMomentum divisor) {
378    return (Per<PerUnit<Dividend, Divisor>, LinearMomentumUnit>) Measure.super.div(divisor);
379  }
380
381  /**
382  * {@inheritDoc}
383  *
384  * @deprecated use div instead. This was renamed for consistency with other languages like Kotlin
385  */
386  @Deprecated(since = "2025", forRemoval = true)
387  @SuppressWarnings({"deprecation", "removal"})
388  @Override
389  default Per<PerUnit<Dividend, Divisor>, LinearMomentumUnit> divide(LinearMomentum divisor) {
390    return div(divisor);
391  }
392
393
394  @Override
395  default Mult<PerUnit<Dividend, Divisor>, LinearVelocityUnit> times(LinearVelocity multiplier) {
396    return (Mult<PerUnit<Dividend, Divisor>, LinearVelocityUnit>) Measure.super.times(multiplier);
397  }
398
399  @Override
400  default Per<PerUnit<Dividend, Divisor>, LinearVelocityUnit> div(LinearVelocity divisor) {
401    return (Per<PerUnit<Dividend, Divisor>, LinearVelocityUnit>) Measure.super.div(divisor);
402  }
403
404  /**
405  * {@inheritDoc}
406  *
407  * @deprecated use div instead. This was renamed for consistency with other languages like Kotlin
408  */
409  @Deprecated(since = "2025", forRemoval = true)
410  @SuppressWarnings({"deprecation", "removal"})
411  @Override
412  default Per<PerUnit<Dividend, Divisor>, LinearVelocityUnit> divide(LinearVelocity divisor) {
413    return div(divisor);
414  }
415
416
417  @Override
418  default Mult<PerUnit<Dividend, Divisor>, MassUnit> times(Mass multiplier) {
419    return (Mult<PerUnit<Dividend, Divisor>, MassUnit>) Measure.super.times(multiplier);
420  }
421
422  @Override
423  default Per<PerUnit<Dividend, Divisor>, MassUnit> div(Mass divisor) {
424    return (Per<PerUnit<Dividend, Divisor>, MassUnit>) Measure.super.div(divisor);
425  }
426
427  /**
428  * {@inheritDoc}
429  *
430  * @deprecated use div instead. This was renamed for consistency with other languages like Kotlin
431  */
432  @Deprecated(since = "2025", forRemoval = true)
433  @SuppressWarnings({"deprecation", "removal"})
434  @Override
435  default Per<PerUnit<Dividend, Divisor>, MassUnit> divide(Mass divisor) {
436    return div(divisor);
437  }
438
439
440  @Override
441  default Mult<PerUnit<Dividend, Divisor>, MomentOfInertiaUnit> times(MomentOfInertia multiplier) {
442    return (Mult<PerUnit<Dividend, Divisor>, MomentOfInertiaUnit>) Measure.super.times(multiplier);
443  }
444
445  @Override
446  default Per<PerUnit<Dividend, Divisor>, MomentOfInertiaUnit> div(MomentOfInertia divisor) {
447    return (Per<PerUnit<Dividend, Divisor>, MomentOfInertiaUnit>) Measure.super.div(divisor);
448  }
449
450  /**
451  * {@inheritDoc}
452  *
453  * @deprecated use div instead. This was renamed for consistency with other languages like Kotlin
454  */
455  @Deprecated(since = "2025", forRemoval = true)
456  @SuppressWarnings({"deprecation", "removal"})
457  @Override
458  default Per<PerUnit<Dividend, Divisor>, MomentOfInertiaUnit> divide(MomentOfInertia divisor) {
459    return div(divisor);
460  }
461
462
463  @Override
464  default Mult<PerUnit<Dividend, Divisor>, MultUnit<?, ?>> times(Mult<?, ?> multiplier) {
465    return (Mult<PerUnit<Dividend, Divisor>, MultUnit<?, ?>>) Measure.super.times(multiplier);
466  }
467
468  @Override
469  default Per<PerUnit<Dividend, Divisor>, MultUnit<?, ?>> div(Mult<?, ?> divisor) {
470    return (Per<PerUnit<Dividend, Divisor>, MultUnit<?, ?>>) Measure.super.div(divisor);
471  }
472
473  /**
474  * {@inheritDoc}
475  *
476  * @deprecated use div instead. This was renamed for consistency with other languages like Kotlin
477  */
478  @Deprecated(since = "2025", forRemoval = true)
479  @SuppressWarnings({"deprecation", "removal"})
480  @Override
481  default Per<PerUnit<Dividend, Divisor>, MultUnit<?, ?>> divide(Mult<?, ?> divisor) {
482    return div(divisor);
483  }
484
485
486  @Override
487  default Mult<PerUnit<Dividend, Divisor>, PerUnit<?, ?>> times(Per<?, ?> multiplier) {
488    return (Mult<PerUnit<Dividend, Divisor>, PerUnit<?, ?>>) Measure.super.times(multiplier);
489  }
490
491  @Override
492  default Per<PerUnit<Dividend, Divisor>, PerUnit<?, ?>> div(Per<?, ?> divisor) {
493    return (Per<PerUnit<Dividend, Divisor>, PerUnit<?, ?>>) Measure.super.div(divisor);
494  }
495
496  /**
497  * {@inheritDoc}
498  *
499  * @deprecated use div instead. This was renamed for consistency with other languages like Kotlin
500  */
501  @Deprecated(since = "2025", forRemoval = true)
502  @SuppressWarnings({"deprecation", "removal"})
503  @Override
504  default Per<PerUnit<Dividend, Divisor>, PerUnit<?, ?>> divide(Per<?, ?> divisor) {
505    return div(divisor);
506  }
507
508
509  @Override
510  default Mult<PerUnit<Dividend, Divisor>, PowerUnit> times(Power multiplier) {
511    return (Mult<PerUnit<Dividend, Divisor>, PowerUnit>) Measure.super.times(multiplier);
512  }
513
514  @Override
515  default Per<PerUnit<Dividend, Divisor>, PowerUnit> div(Power divisor) {
516    return (Per<PerUnit<Dividend, Divisor>, PowerUnit>) Measure.super.div(divisor);
517  }
518
519  /**
520  * {@inheritDoc}
521  *
522  * @deprecated use div instead. This was renamed for consistency with other languages like Kotlin
523  */
524  @Deprecated(since = "2025", forRemoval = true)
525  @SuppressWarnings({"deprecation", "removal"})
526  @Override
527  default Per<PerUnit<Dividend, Divisor>, PowerUnit> divide(Power divisor) {
528    return div(divisor);
529  }
530
531
532  @Override
533  default Mult<PerUnit<Dividend, Divisor>, ResistanceUnit> times(Resistance multiplier) {
534    return (Mult<PerUnit<Dividend, Divisor>, ResistanceUnit>) Measure.super.times(multiplier);
535  }
536
537  @Override
538  default Per<PerUnit<Dividend, Divisor>, ResistanceUnit> div(Resistance divisor) {
539    return (Per<PerUnit<Dividend, Divisor>, ResistanceUnit>) Measure.super.div(divisor);
540  }
541
542  /**
543  * {@inheritDoc}
544  *
545  * @deprecated use div instead. This was renamed for consistency with other languages like Kotlin
546  */
547  @Deprecated(since = "2025", forRemoval = true)
548  @SuppressWarnings({"deprecation", "removal"})
549  @Override
550  default Per<PerUnit<Dividend, Divisor>, ResistanceUnit> divide(Resistance divisor) {
551    return div(divisor);
552  }
553
554
555  @Override
556  default Mult<PerUnit<Dividend, Divisor>, TemperatureUnit> times(Temperature multiplier) {
557    return (Mult<PerUnit<Dividend, Divisor>, TemperatureUnit>) Measure.super.times(multiplier);
558  }
559
560  @Override
561  default Per<PerUnit<Dividend, Divisor>, TemperatureUnit> div(Temperature divisor) {
562    return (Per<PerUnit<Dividend, Divisor>, TemperatureUnit>) Measure.super.div(divisor);
563  }
564
565  /**
566  * {@inheritDoc}
567  *
568  * @deprecated use div instead. This was renamed for consistency with other languages like Kotlin
569  */
570  @Deprecated(since = "2025", forRemoval = true)
571  @SuppressWarnings({"deprecation", "removal"})
572  @Override
573  default Per<PerUnit<Dividend, Divisor>, TemperatureUnit> divide(Temperature divisor) {
574    return div(divisor);
575  }
576
577
578  @Override
579  default Mult<PerUnit<Dividend, Divisor>, TimeUnit> times(Time multiplier) {
580    return (Mult<PerUnit<Dividend, Divisor>, TimeUnit>) Measure.super.times(multiplier);
581  }
582
583  @Override
584  default Velocity<PerUnit<Dividend, Divisor>> div(Time divisor) {
585    return VelocityUnit.combine(unit(), divisor.unit()).ofBaseUnits(baseUnitMagnitude() / divisor.baseUnitMagnitude());
586  }
587
588  /**
589  * {@inheritDoc}
590  *
591  * @deprecated use div instead. This was renamed for consistency with other languages like Kotlin
592  */
593  @Deprecated(since = "2025", forRemoval = true)
594  @SuppressWarnings({"deprecation", "removal"})
595  @Override
596  default Velocity<PerUnit<Dividend, Divisor>> divide(Time divisor) {
597    return div(divisor);
598  }
599
600
601  @Override
602  default Mult<PerUnit<Dividend, Divisor>, TorqueUnit> times(Torque multiplier) {
603    return (Mult<PerUnit<Dividend, Divisor>, TorqueUnit>) Measure.super.times(multiplier);
604  }
605
606  @Override
607  default Per<PerUnit<Dividend, Divisor>, TorqueUnit> div(Torque divisor) {
608    return (Per<PerUnit<Dividend, Divisor>, TorqueUnit>) Measure.super.div(divisor);
609  }
610
611  /**
612  * {@inheritDoc}
613  *
614  * @deprecated use div instead. This was renamed for consistency with other languages like Kotlin
615  */
616  @Deprecated(since = "2025", forRemoval = true)
617  @SuppressWarnings({"deprecation", "removal"})
618  @Override
619  default Per<PerUnit<Dividend, Divisor>, TorqueUnit> divide(Torque divisor) {
620    return div(divisor);
621  }
622
623
624  @Override
625  default Mult<PerUnit<Dividend, Divisor>, VelocityUnit<?>> times(Velocity<?> multiplier) {
626    return (Mult<PerUnit<Dividend, Divisor>, VelocityUnit<?>>) Measure.super.times(multiplier);
627  }
628
629  @Override
630  default Per<PerUnit<Dividend, Divisor>, VelocityUnit<?>> div(Velocity<?> divisor) {
631    return (Per<PerUnit<Dividend, Divisor>, VelocityUnit<?>>) Measure.super.div(divisor);
632  }
633
634  /**
635  * {@inheritDoc}
636  *
637  * @deprecated use div instead. This was renamed for consistency with other languages like Kotlin
638  */
639  @Deprecated(since = "2025", forRemoval = true)
640  @SuppressWarnings({"deprecation", "removal"})
641  @Override
642  default Per<PerUnit<Dividend, Divisor>, VelocityUnit<?>> divide(Velocity<?> divisor) {
643    return div(divisor);
644  }
645
646
647  @Override
648  default Mult<PerUnit<Dividend, Divisor>, VoltageUnit> times(Voltage multiplier) {
649    return (Mult<PerUnit<Dividend, Divisor>, VoltageUnit>) Measure.super.times(multiplier);
650  }
651
652  @Override
653  default Per<PerUnit<Dividend, Divisor>, VoltageUnit> div(Voltage divisor) {
654    return (Per<PerUnit<Dividend, Divisor>, VoltageUnit>) Measure.super.div(divisor);
655  }
656
657  /**
658  * {@inheritDoc}
659  *
660  * @deprecated use div instead. This was renamed for consistency with other languages like Kotlin
661  */
662  @Deprecated(since = "2025", forRemoval = true)
663  @SuppressWarnings({"deprecation", "removal"})
664  @Override
665  default Per<PerUnit<Dividend, Divisor>, VoltageUnit> divide(Voltage divisor) {
666    return div(divisor);
667  }
668default Measure<Dividend> timesDivisor(Measure<? extends Divisor> multiplier) {
669  return (Measure<Dividend>) baseUnit().numerator().ofBaseUnits(baseUnitMagnitude() * multiplier.baseUnitMagnitude());
670}
671
672default Measure<? extends PerUnit<Divisor, Dividend>> reciprocal() {
673  // May return a velocity if Divisor == TimeUnit, so we can't guarantee a "Per" instance
674  return baseUnit().reciprocal().ofBaseUnits(1 / baseUnitMagnitude());
675}
676}