mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-04 23:39:07 +07:00
[diff] add equals/hashCode to ListSelection
GitOrigin-RevId: 01959b04b145db98b2ba973c31ccad04ed62a2bd
This commit is contained in:
committed by
intellij-monorepo-bot
parent
db04a536d8
commit
06d6da671c
@@ -576,9 +576,11 @@ f:com.intellij.openapi.ListSelection
|
||||
- s:createAt(java.util.List,I):com.intellij.openapi.ListSelection
|
||||
- s:createSingleton(java.lang.Object):com.intellij.openapi.ListSelection
|
||||
- s:empty():com.intellij.openapi.ListSelection
|
||||
- equals(java.lang.Object):Z
|
||||
- getExplicitSelection():java.util.List
|
||||
- getList():java.util.List
|
||||
- getSelectedIndex():I
|
||||
- hashCode():I
|
||||
- isEmpty():Z
|
||||
- isExplicitSelection():Z
|
||||
- map(com.intellij.util.NullableFunction):com.intellij.openapi.ListSelection
|
||||
|
||||
@@ -7,10 +7,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* Utility class used to preserve index during 'map' operations
|
||||
@@ -122,4 +119,18 @@ public final class ListSelection<T> {
|
||||
public boolean isExplicitSelection() {
|
||||
return myExplicitSelection;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (!(o instanceof ListSelection<?> selection)) return false;
|
||||
return mySelectedIndex == selection.mySelectedIndex &&
|
||||
myExplicitSelection == selection.myExplicitSelection &&
|
||||
Objects.equals(myList, selection.myList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(myList, mySelectedIndex, myExplicitSelection);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user