3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-09-08 22:02:50 +02:00

Implement hashCode for version

Dieser Commit ist enthalten in:
Myles 2019-05-27 18:10:57 +01:00
Ursprung 744fa25349
Commit 5364d89ca8

Datei anzeigen

@ -2,6 +2,8 @@ package us.myles.ViaVersion.update;
import com.google.common.base.Joiner;
import java.util.Arrays;
import java.util.Objects;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@ -85,6 +87,13 @@ public class Version implements Comparable<Version> {
return that instanceof Version && equals(this, (Version) that);
}
@Override
public int hashCode() {
int result = Objects.hash(tag);
result = 31 * result + Arrays.hashCode(parts);
return result;
}
/**
* Get the tag, eg. -ALPHA
*