feat: 兼容1.0.0

This commit is contained in:
2023-10-25 22:46:20 +08:00
parent 6547e7e5d7
commit 818a480e42

View File

@@ -0,0 +1,36 @@
package cn.hamster3.mc.plugin.core.common.util;
import java.io.Serializable;
import java.util.Objects;
@SuppressWarnings("unused")
public class Pair<K, V> implements Serializable {
private final K key;
private final V value;
public Pair(K key, V value) {
this.key = key;
this.value = value;
}
public K getKey() {
return key;
}
public V getValue() {
return value;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Pair<?, ?> pair = (Pair<?, ?>) o;
return Objects.equals(key, pair.key) && Objects.equals(value, pair.value);
}
@Override
public int hashCode() {
return Objects.hash(key, value);
}
}