三元组ImmutableTriple成员修改为final/6.0.3改为6.0.0

This commit is contained in:
20035729 2023-04-07 10:56:52 +08:00
parent cf4e64a49b
commit d0b7445fa8
2 changed files with 10 additions and 10 deletions

View File

@ -15,9 +15,9 @@ import java.util.Objects;
public class ImmutableTriple<L, M, R> implements Serializable { public class ImmutableTriple<L, M, R> implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
protected L left; protected final L left;
protected M middle; protected final M middle;
protected R right; protected final R right;
/** /**
* 构建ImmutableTriple对象 * 构建ImmutableTriple对象
@ -87,9 +87,9 @@ public class ImmutableTriple<L, M, R> implements Serializable {
} }
if (o instanceof ImmutableTriple) { if (o instanceof ImmutableTriple) {
ImmutableTriple<?, ?, ?> triple = (ImmutableTriple<?, ?, ?>) o; ImmutableTriple<?, ?, ?> triple = (ImmutableTriple<?, ?, ?>) o;
return Objects.equals(getLeft(), triple.getLeft()) && return Objects.equals(left, triple.getLeft()) &&
Objects.equals(getMiddle(), triple.getMiddle()) && Objects.equals(middle, triple.getMiddle()) &&
Objects.equals(getRight(), triple.getRight()); Objects.equals(right, triple.getRight());
} }
return false; return false;
} }

View File

@ -10,7 +10,7 @@ import java.util.Objects;
* @param <M> 中值类型 * @param <M> 中值类型
* @param <R> 右值类型 * @param <R> 右值类型
* @author kirno7 * @author kirno7
* @since 6.0.3 * @since 6.0.0
*/ */
public class MutableTriple<L, M, R> implements Serializable { public class MutableTriple<L, M, R> implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -114,9 +114,9 @@ public class MutableTriple<L, M, R> implements Serializable {
} }
if (o instanceof MutableTriple) { if (o instanceof MutableTriple) {
MutableTriple<?, ?, ?> triple = (MutableTriple<?, ?, ?>) o; MutableTriple<?, ?, ?> triple = (MutableTriple<?, ?, ?>) o;
return Objects.equals(getLeft(), triple.getLeft()) && return Objects.equals(left, triple.getLeft()) &&
Objects.equals(getMiddle(), triple.getMiddle()) && Objects.equals(middle, triple.getMiddle()) &&
Objects.equals(getRight(), triple.getRight()); Objects.equals(right, triple.getRight());
} }
return false; return false;
} }