equals

open operator override fun equals(other: Any?): Boolean

QuestionnaireItemViewItem is a transient object for the UI only. Whenever the user makes any change via the UI, a new list of QuestionnaireItemViewItems will be created, each holding references to the underlying QuestionnaireItem and QuestionnaireResponseItem. To avoid refreshing the UI unnecessarily with the same QuestionnaireItems and QuestionnaireResponseItems, we consider two QuestionnaireItemViewItems to be the same if they have the same underlying QuestionnaireItem and QuestionnaireResponseItem. See QuestionnaireItemAdapter.DiffCallback.

On the other hand, under certain circumstances, the underlying QuestionnaireResponseItem might be recreated for the same question. For example, if a QuestionnaireItem is nested under another QuestionnaireItem, the s will be nested under the parent QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent, and if the QuestionnaireResponse.QuestionnaireResponseItemAnswerComponent is changed, the nested QuestionnaireResponseItem will be recreated, too. In such cases, it would be incorrect to simply check that the linkId of the underlying QuestionnaireItem and QuestionnaireResponseItem match.