mirror of
https://github.com/nextcloud/talk-android
synced 2025-02-01 12:11:59 +00:00
Spotbugs: proper equals and hashCode
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
bf8c113f9a
commit
093e6a15bc
@ -28,6 +28,7 @@ import com.nextcloud.talk.R;
|
|||||||
import com.nextcloud.talk.databinding.RvItemNotificationSoundBinding;
|
import com.nextcloud.talk.databinding.RvItemNotificationSoundBinding;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
import eu.davidea.flexibleadapter.FlexibleAdapter;
|
import eu.davidea.flexibleadapter.FlexibleAdapter;
|
||||||
import eu.davidea.flexibleadapter.items.AbstractFlexibleItem;
|
import eu.davidea.flexibleadapter.items.AbstractFlexibleItem;
|
||||||
@ -54,9 +55,28 @@ public class NotificationSoundItem extends AbstractFlexibleItem<NotificationSoun
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
|
if (this == o) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (o == null || getClass() != o.getClass()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NotificationSoundItem that = (NotificationSoundItem) o;
|
||||||
|
|
||||||
|
if (!Objects.equals(notificationSoundName, that.notificationSoundName)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return Objects.equals(notificationSoundUri, that.notificationSoundUri);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
int result = notificationSoundName != null ? notificationSoundName.hashCode() : 0;
|
||||||
|
result = 31 * result + (notificationSoundUri != null ? notificationSoundUri.hashCode() : 0);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getLayoutRes() {
|
public int getLayoutRes() {
|
||||||
return R.layout.rv_item_notification_sound;
|
return R.layout.rv_item_notification_sound;
|
||||||
|
Loading…
Reference in New Issue
Block a user