com.daveayan.mirage.comparator.impl.LeafDoubleComparator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mirage Show documentation
Show all versions of mirage Show documentation
This library provides methods around Java Reflection
package com.daveayan.mirage.comparator.impl;
import com.daveayan.mirage.ObjectComparator;
import com.daveayan.mirage.comparator.Comparator;
public class LeafDoubleComparator implements Comparator {
public boolean canCompare(Object objectLeft, Object objectRight, ObjectComparator oc) {
return (objectLeft instanceof Double) & (objectRight instanceof Double);
}
public boolean compare(Object objectLeft, Object objectRight, ObjectComparator oc) {
return ((Double) objectLeft).equals((Double) objectRight);
}
}