summaryrefslogtreecommitdiff
path: root/src/org/unitConverter/math/ObjectProduct.java
diff options
context:
space:
mode:
authorAdrien Hopkins <masterofnumbers17@gmail.com>2019-10-17 16:31:38 -0400
committerAdrien Hopkins <masterofnumbers17@gmail.com>2019-10-17 16:58:55 -0400
commitb491a1d67b513f6a6f549fe6fcb374d731e0beca (patch)
tree843e8933a5e8f6c1b56bcd0025cfeb89ad29e85a /src/org/unitConverter/math/ObjectProduct.java
parent54ab9c05234b09547e2a01b1eab812420c6a3dda (diff)
Changed the ZeroIsNullMap to a more general ConditionalExistenceMap.
Diffstat (limited to 'src/org/unitConverter/math/ObjectProduct.java')
-rw-r--r--src/org/unitConverter/math/ObjectProduct.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/org/unitConverter/math/ObjectProduct.java b/src/org/unitConverter/math/ObjectProduct.java
index 21ab207..0cf89ec 100644
--- a/src/org/unitConverter/math/ObjectProduct.java
+++ b/src/org/unitConverter/math/ObjectProduct.java
@@ -92,7 +92,8 @@ public final class ObjectProduct<T> {
* @since 2019-10-16
*/
private ObjectProduct(final Map<T, Integer> exponents) {
- this.exponents = Collections.unmodifiableMap(ZeroIsNullMap.create(new HashMap<>(exponents)));
+ this.exponents = Collections.unmodifiableMap(ConditionalExistenceCollections
+ .conditionalExistenceMap(new HashMap<>(exponents), e -> !Integer.valueOf(0).equals(e.getValue())));
}
/**