* Mult<Force, Distance, Torque>
*
* @param the type of the first unit in the result
* @param the type of the second unit in the result
*/
public class Mult, B extends Unit> extends Unit* Mult.combine(Volts, Meters) // => Volt-Meters ** *
It's recommended to use the convenience function {@link Unit#mult(Unit)} instead of calling * this factory directly. * * @param the type of the first unit * @param the type of the second unit * @param a the first unit * @param b the second unit * @return the combined unit */ @SuppressWarnings({"unchecked", "rawtypes"}) public static , B extends Unit> Mult combine(A a, B b) { final long key = ((long) a.hashCode()) << 32L | ((long) b.hashCode()) & 0xFFFFFFFFL; if (cache.containsKey(key)) { return cache.get(key); } var mult = new Mult((Class) Mult.class, a, b); cache.put(key, mult); return mult; } public A unitA() { return m_unitA; } public B unitB() { return m_unitB; } @Override public String toString() { return "(" + m_unitA.toString() + " * " + m_unitB.toString() + ")"; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } if (!super.equals(o)) { return false; } Mult, ?> mult = (Mult, ?>) o; return Objects.equals(m_unitA, mult.m_unitA) && Objects.equals(m_unitB, mult.m_unitB); } @Override public int hashCode() { return Objects.hash(super.hashCode(), m_unitA, m_unitB); } }