From f7753edc338cd8732805d2047856101a48a234a2 Mon Sep 17 00:00:00 2001 From: Yehoshua Oliveira Date: Tue, 12 Jan 2021 14:11:37 -0300 Subject: [PATCH] feat: adds equality check for Datums --- .../br/com/skywalker/coordinateconverter/Datum.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/br/com/skywalker/coordinateconverter/Datum.java b/src/main/java/br/com/skywalker/coordinateconverter/Datum.java index 50a69e9..6773972 100644 --- a/src/main/java/br/com/skywalker/coordinateconverter/Datum.java +++ b/src/main/java/br/com/skywalker/coordinateconverter/Datum.java @@ -14,4 +14,12 @@ public interface Datum { String name(); -} \ No newline at end of file + default boolean isEqual(Datum other) { + return null != other && + this.getSemiAxis() == other.getSemiAxis() && + this.getFlatness() == other.getFlatness() && + this.getDeltaX() == other.getDeltaX() && + this.getDeltaY() == other.getDeltaY() && + this.getDeltaZ() == other.getDeltaZ(); + } +}