def METHOD_NAME(self, other, all_parameters: bool) -> bool:
    compare_parameters = (
        parameters_are_equal if all_parameters else type_parameters_equal
    )
    return (
        isinstance(other, type(self))
        and (self._primitive == other._primitive)
        and compare_parameters(self._parameters, other._parameters)
    )