mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
vcs: Convert "ChangeListChange" to kotlin
GitOrigin-RevId: 8cfc53c8b044c7be598c317e7526b3ca69f0574d
This commit is contained in:
committed by
intellij-monorepo-bot
parent
6136470c30
commit
82e35e8aa6
@@ -1,61 +1,25 @@
|
||||
// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.openapi.vcs.changes;
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.openapi.vcs.changes
|
||||
|
||||
import gnu.trove.TObjectHashingStrategy;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import gnu.trove.TObjectHashingStrategy
|
||||
import java.util.*
|
||||
|
||||
import java.util.Objects;
|
||||
class ChangeListChange(
|
||||
val change: Change,
|
||||
val changeListName: String,
|
||||
val changeListId: String
|
||||
) : Change(change) {
|
||||
|
||||
public class ChangeListChange extends Change {
|
||||
@NotNull private final Change myChange;
|
||||
@NotNull private final String myChangeListName;
|
||||
private final String myChangeListId;
|
||||
companion object {
|
||||
@JvmField
|
||||
val HASHING_STRATEGY: TObjectHashingStrategy<Any> = object : TObjectHashingStrategy<Any> {
|
||||
override fun computeHashCode(o: Any): Int = Objects.hashCode(o)
|
||||
|
||||
public ChangeListChange(@NotNull Change change,
|
||||
@NotNull String changeListName,
|
||||
@NotNull String changeListId) {
|
||||
super(change);
|
||||
myChange = change;
|
||||
myChangeListName = changeListName;
|
||||
myChangeListId = changeListId;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Change getChange() {
|
||||
return myChange;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String getChangeListName() {
|
||||
return myChangeListName;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String getChangeListId() {
|
||||
return myChangeListId;
|
||||
}
|
||||
|
||||
|
||||
public static final TObjectHashingStrategy<Object> HASHING_STRATEGY = new TObjectHashingStrategy<Object>() {
|
||||
@Override
|
||||
public int computeHashCode(Object object) {
|
||||
return Objects.hashCode(object);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o1, Object o2) {
|
||||
if (o1 instanceof Change && o2 instanceof Change) {
|
||||
if (o1 instanceof ChangeListChange || o2 instanceof ChangeListChange) {
|
||||
if (o1 instanceof ChangeListChange && o2 instanceof ChangeListChange) {
|
||||
ChangeListChange lc1 = (ChangeListChange)o1;
|
||||
ChangeListChange lc2 = (ChangeListChange)o2;
|
||||
return Objects.equals(o1, o2) &&
|
||||
Objects.equals(lc1.getChangeListId(), lc2.getChangeListId());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
override fun equals(o1: Any, o2: Any): Boolean = when {
|
||||
o1 is ChangeListChange && o2 is ChangeListChange -> o1 == o2 && o1.changeListId == o2.changeListId
|
||||
o1 is ChangeListChange || o2 is ChangeListChange -> false
|
||||
else -> o1 == o2
|
||||
}
|
||||
return Objects.equals(o1, o2);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user