mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-07 22:09:38 +07:00
[java-psi] NullabilityAnnotationInfo: equals/hashCode
GitOrigin-RevId: c9f6edf9c1f4a45f04a8ca1ded4a86fa6e68045d
This commit is contained in:
committed by
intellij-monorepo-bot
parent
f987efc8a9
commit
5259525948
@@ -7,6 +7,8 @@ import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Represents a particular nullability annotation instance
|
||||
*/
|
||||
@@ -90,6 +92,26 @@ public class NullabilityAnnotationInfo {
|
||||
return new TypeNullability(myNullability, source);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
NullabilityAnnotationInfo info = (NullabilityAnnotationInfo)o;
|
||||
return myContainer == info.myContainer &&
|
||||
myAnnotation.equals(info.myAnnotation) &&
|
||||
myNullability == info.myNullability &&
|
||||
Objects.equals(myInheritedFrom, info.myInheritedFrom);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = myAnnotation.hashCode();
|
||||
result = 31 * result + myNullability.hashCode();
|
||||
result = 31 * result + Objects.hashCode(myInheritedFrom);
|
||||
result = 31 * result + Boolean.hashCode(myContainer);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "NullabilityAnnotationInfo{" +
|
||||
|
||||
Reference in New Issue
Block a user