1
0
Fork 0
mirror of https://github.com/graphhopper/jsprit.git synced 2020-01-24 07:45:05 +01:00

add hashcode and equals to Capacity

This commit is contained in:
oblonski 2016-07-13 13:52:10 +02:00
parent 82565b4416
commit 6eee38d2fc

View file

@ -16,6 +16,8 @@
******************************************************************************/ ******************************************************************************/
package com.graphhopper.jsprit.core.problem; package com.graphhopper.jsprit.core.problem;
import java.util.Arrays;
/** /**
* Capacity with an arbitrary number of capacity-dimension. * Capacity with an arbitrary number of capacity-dimension.
* <p> * <p>
@ -290,5 +292,20 @@ public class Capacity {
return toReturnBuilder.build(); return toReturnBuilder.build();
} }
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof Capacity)) return false;
Capacity capacity = (Capacity) o;
if (!Arrays.equals(dimensions, capacity.dimensions)) return false;
return true;
}
@Override
public int hashCode() {
return Arrays.hashCode(dimensions);
}
} }