3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-10-08 11:10:06 +02:00

Add PacketValue toString

Dieser Commit ist enthalten in:
Nassim Jahnke 2023-03-17 13:26:13 +01:00
Ursprung d4894ca4b5
Commit 2e59a51734
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 6BE3B555EBC5982B

Datei anzeigen

@ -39,6 +39,7 @@ import java.util.ArrayList;
import java.util.Deque;
import java.util.List;
import java.util.NoSuchElementException;
import java.util.Objects;
import org.checkerframework.checker.nullness.qual.Nullable;
public class PacketWrapperImpl implements PacketWrapper {
@ -535,5 +536,29 @@ public class PacketWrapperImpl implements PacketWrapper {
public void setValue(@Nullable Object value) {
this.value = value;
}
@Override
public boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
final PacketValue that = (PacketValue) o;
if (!type.equals(that.type)) return false;
return Objects.equals(value, that.value);
}
@Override
public int hashCode() {
int result = type.hashCode();
result = 31 * result + (value != null ? value.hashCode() : 0);
return result;
}
@Override
public String toString() {
return "{"
+ type +
", " + value +
'}';
}
}
}