public static bool IsSame()

in src/Azure.IIoT.OpcUa/src/Publisher/Extensions/OpcNodeModelEx.cs [47:191]


        public static bool IsSame(this OpcNodeModel? model, OpcNodeModel? that,
            bool includeTriggeredNodes = true)
        {
            if (ReferenceEquals(model, that))
            {
                return true;
            }
            if (model is null || that is null)
            {
                return false;
            }

            if (!string.Equals(model.Id ?? string.Empty,
                that.Id ?? string.Empty, StringComparison.OrdinalIgnoreCase))
            {
                return false;
            }

            if (!string.Equals(model.DisplayName ?? string.Empty,
                that.DisplayName ?? string.Empty, StringComparison.OrdinalIgnoreCase))
            {
                return false;
            }

            if (!string.Equals(model.Topic ?? string.Empty,
                that.Topic ?? string.Empty, StringComparison.OrdinalIgnoreCase))
            {
                return false;
            }

            if ((model.QualityOfService ?? QoS.AtLeastOnce) !=
                (that.QualityOfService ?? QoS.AtLeastOnce))
            {
                return false;
            }

            if (!string.Equals(model.DataSetFieldId ?? string.Empty,
                that.DataSetFieldId ?? string.Empty, StringComparison.OrdinalIgnoreCase))
            {
                return false;
            }

            if (model.DataSetClassFieldId != that.DataSetClassFieldId)
            {
                return false;
            }

            if (!string.Equals(model.ExpandedNodeId,
                that.ExpandedNodeId, StringComparison.OrdinalIgnoreCase))
            {
                return false;
            }

            if (model.GetNormalizedPublishingInterval() != that.GetNormalizedPublishingInterval())
            {
                return false;
            }

            if (model.GetNormalizedSamplingInterval() != that.GetNormalizedSamplingInterval())
            {
                return false;
            }

            if (model.GetNormalizedHeartbeatInterval() != that.GetNormalizedHeartbeatInterval())
            {
                return false;
            }

            if ((model.HeartbeatBehavior ?? HeartbeatBehavior.WatchdogLKV) !=
                (that.HeartbeatBehavior ?? HeartbeatBehavior.WatchdogLKV))
            {
                return false;
            }

            if ((model.SkipFirst ?? false) != (that.SkipFirst ?? false))
            {
                return false;
            }

            if ((model.DiscardNew ?? false) != (that.DiscardNew ?? false))
            {
                return false;
            }

            if (model.QueueSize != that.QueueSize)
            {
                return false;
            }

            //
            // Null is default and equals to StatusValue, but we allow StatusValue == 1
            // to be set specifically to enable a user to force a data filter to be
            // applied (otherwise it is not if nothing else is set)
            //
            if (model.DataChangeTrigger != that.DataChangeTrigger)
            {
                return false;
            }

            // Null is None == no deadband
            if (model.DeadbandType != that.DeadbandType)
            {
                return false;
            }

            if (model.DeadbandValue != that.DeadbandValue)
            {
                return false;
            }

            if (!model.EventFilter.IsSameAs(that.EventFilter))
            {
                return false;
            }

            if (!model.ModelChangeHandling.IsSameAs(that.ModelChangeHandling))
            {
                return false;
            }

            if (!model.ConditionHandling.IsSameAs(that.ConditionHandling))
            {
                return false;
            }

            if ((model.UseCyclicRead ?? false) != (that.UseCyclicRead ?? false))
            {
                return false;
            }
            if (model.GetNormalizedCyclicReadMaxAge() != that.GetNormalizedCyclicReadMaxAge())
            {
                return false;
            }
            if ((model.RegisterNode ?? false) != (that.RegisterNode ?? false))
            {
                return false;
            }
            if (includeTriggeredNodes &&
                model.TriggeredNodes?.SetEqualsSafe(that.TriggeredNodes,
                    (a, b) => a.IsSame(b, false)) == false)
            {
                return false;
            }
            return true;
        }