added static method equals to ValueIdentity

This commit is contained in:
2019-08-26 23:12:54 +01:00
parent 09a8ddde19
commit ea1bfc84c7
2 changed files with 6 additions and 2 deletions

View File

@@ -6,8 +6,6 @@ import net.woggioni.worth.traversal.TraversalContext;
import net.woggioni.worth.traversal.ValueIdentity;
import net.woggioni.worth.traversal.ValueVisitor;
import net.woggioni.worth.traversal.ValueWalker;
import net.woggioni.worth.value.ArrayValue;
import net.woggioni.worth.value.ObjectValue;
import net.woggioni.worth.xface.Dumper;
import net.woggioni.worth.xface.Value;

View File

@@ -3,6 +3,8 @@ package net.woggioni.worth.traversal;
import lombok.RequiredArgsConstructor;
import net.woggioni.worth.xface.Value;
import java.util.Objects;
@RequiredArgsConstructor
public class ValueIdentity {
@@ -23,4 +25,8 @@ public class ValueIdentity {
return value == ((ValueIdentity) other).value;
}
}
public static boolean equals(Value v1, Value v2) {
return Objects.equals(new ValueIdentity(v1), new ValueIdentity(v2));
}
}