From 818a480e42ba0e079c221c24ac7c30328456ec57 Mon Sep 17 00:00:00 2001 From: MiniDay <372403923@qq.com> Date: Wed, 25 Oct 2023 22:46:20 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=85=BC=E5=AE=B91.0.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mc/plugin/core/common/util/Pair.java | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 core-common/src/main/java/cn/hamster3/mc/plugin/core/common/util/Pair.java diff --git a/core-common/src/main/java/cn/hamster3/mc/plugin/core/common/util/Pair.java b/core-common/src/main/java/cn/hamster3/mc/plugin/core/common/util/Pair.java new file mode 100644 index 0000000..f455876 --- /dev/null +++ b/core-common/src/main/java/cn/hamster3/mc/plugin/core/common/util/Pair.java @@ -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 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); + } +}