Implement hasCode based on equals() elements to fullfil hasCode/equals contract

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
Andy Scherzinger 2022-12-16 14:51:40 +01:00
parent 35fec87aaa
commit ae6b7156c0
No known key found for this signature in database
GPG Key ID: 6CADC7E3523C308B
2 changed files with 12 additions and 0 deletions

View File

@ -30,6 +30,7 @@ import com.nextcloud.talk.databinding.RvItemTitleHeaderBinding;
import com.nextcloud.talk.ui.theme.ViewThemeUtils;
import java.util.List;
import java.util.Objects;
import eu.davidea.flexibleadapter.FlexibleAdapter;
import eu.davidea.flexibleadapter.items.AbstractHeaderItem;
@ -63,6 +64,11 @@ public class GenericTextHeaderItem extends AbstractHeaderItem<GenericTextHeaderI
return false;
}
@Override
public int hashCode() {
return Objects.hash(title);
}
@Override
public int getLayoutRes() {
return R.layout.rv_item_title_header;

View File

@ -39,6 +39,7 @@ import com.nextcloud.talk.ui.theme.ViewThemeUtils;
import com.nextcloud.talk.utils.DisplayUtils;
import java.util.List;
import java.util.Objects;
import java.util.regex.Pattern;
import androidx.constraintlayout.widget.ConstraintLayout;
@ -108,6 +109,11 @@ public class MentionAutocompleteItem extends AbstractFlexibleItem<ParticipantIte
return false;
}
@Override
public int hashCode() {
return Objects.hash(objectId, displayName);
}
@Override
public int getLayoutRes() {
return R.layout.rv_item_conversation_info_participant;