added static method equals
to ValueIdentity
This commit is contained in:
@@ -6,8 +6,6 @@ import net.woggioni.worth.traversal.TraversalContext;
|
|||||||
import net.woggioni.worth.traversal.ValueIdentity;
|
import net.woggioni.worth.traversal.ValueIdentity;
|
||||||
import net.woggioni.worth.traversal.ValueVisitor;
|
import net.woggioni.worth.traversal.ValueVisitor;
|
||||||
import net.woggioni.worth.traversal.ValueWalker;
|
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.Dumper;
|
||||||
import net.woggioni.worth.xface.Value;
|
import net.woggioni.worth.xface.Value;
|
||||||
|
|
||||||
|
@@ -3,6 +3,8 @@ package net.woggioni.worth.traversal;
|
|||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import net.woggioni.worth.xface.Value;
|
import net.woggioni.worth.xface.Value;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class ValueIdentity {
|
public class ValueIdentity {
|
||||||
|
|
||||||
@@ -23,4 +25,8 @@ public class ValueIdentity {
|
|||||||
return value == ((ValueIdentity) other).value;
|
return value == ((ValueIdentity) other).value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean equals(Value v1, Value v2) {
|
||||||
|
return Objects.equals(new ValueIdentity(v1), new ValueIdentity(v2));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user