From 3b88d5f10e01d93a21931dfc7c395ea0c477de21 Mon Sep 17 00:00:00 2001 From: Graham Date: Sun, 22 Dec 2019 22:26:12 +0000 Subject: [PATCH] Convert SourcedIntValue to Kotlin --- .../deob/analysis/SourcedIntValue.java | 51 ------------------- .../openrs2/deob/analysis/SourcedIntValue.kt | 6 +++ 2 files changed, 6 insertions(+), 51 deletions(-) delete mode 100644 deob/src/main/java/dev/openrs2/deob/analysis/SourcedIntValue.java create mode 100644 deob/src/main/java/dev/openrs2/deob/analysis/SourcedIntValue.kt diff --git a/deob/src/main/java/dev/openrs2/deob/analysis/SourcedIntValue.java b/deob/src/main/java/dev/openrs2/deob/analysis/SourcedIntValue.java deleted file mode 100644 index c40d1859..00000000 --- a/deob/src/main/java/dev/openrs2/deob/analysis/SourcedIntValue.java +++ /dev/null @@ -1,51 +0,0 @@ -package dev.openrs2.deob.analysis; - -import java.util.Objects; - -import com.google.common.base.MoreObjects; -import dev.openrs2.asm.MemberRef; -import dev.openrs2.util.collect.DisjointSet; - -public final class SourcedIntValue { - private final DisjointSet.Partition source; - private final IntValue intValue; - - public SourcedIntValue(DisjointSet.Partition source, IntValue intValue) { - this.source = source; - this.intValue = intValue; - } - - public DisjointSet.Partition getSource() { - return source; - } - - public IntValue getIntValue() { - return intValue; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SourcedIntValue that = (SourcedIntValue) o; - return source.equals(that.source) && - intValue.equals(that.intValue); - } - - @Override - public int hashCode() { - return Objects.hash(source, intValue); - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this) - .add("source", source) - .add("intValue", intValue) - .toString(); - } -} diff --git a/deob/src/main/java/dev/openrs2/deob/analysis/SourcedIntValue.kt b/deob/src/main/java/dev/openrs2/deob/analysis/SourcedIntValue.kt new file mode 100644 index 00000000..43cd8acd --- /dev/null +++ b/deob/src/main/java/dev/openrs2/deob/analysis/SourcedIntValue.kt @@ -0,0 +1,6 @@ +package dev.openrs2.deob.analysis + +import dev.openrs2.asm.MemberRef +import dev.openrs2.util.collect.DisjointSet + +data class SourcedIntValue(val source: DisjointSet.Partition, val intValue: IntValue)