Beispiel #1
0
 public bool Equals(Classification other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(Label == other.Label && Confidence.Equals(other.Confidence));
 }
        /// <summary>
        /// Returns true if BrandedFoodObjectDietLabelsGlutenFree instances are equal
        /// </summary>
        /// <param name="other">Instance of BrandedFoodObjectDietLabelsGlutenFree to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(BrandedFoodObjectDietLabelsGlutenFree other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                     ) &&
                 (
                     IsCompatible == other.IsCompatible ||
                     IsCompatible != null &&
                     IsCompatible.Equals(other.IsCompatible)
                 ) &&
                 (
                     CompatibilityLevel == other.CompatibilityLevel ||
                     CompatibilityLevel != null &&
                     CompatibilityLevel.Equals(other.CompatibilityLevel)
                 ) &&
                 (
                     Confidence == other.Confidence ||
                     Confidence != null &&
                     Confidence.Equals(other.Confidence)
                 ) &&
                 (
                     ConfidenceDescription == other.ConfidenceDescription ||
                     ConfidenceDescription != null &&
                     ConfidenceDescription.Equals(other.ConfidenceDescription)
                 ));
        }
Beispiel #3
0
        /// <summary>Indicates whether the current object is equal to another object of the same type.</summary>
        /// <returns>true if the current object is equal to the <paramref name="other" /> parameter; otherwise, false.</returns>
        /// <param name="other">An object to compare with this object.</param>
        public bool Equals(Alpha other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            if (Id == other.Id)
            {
                return(true);
            }

            return(Equals(Symbol, other.Symbol) &&
                   Direction == other.Direction &&
                   Type == other.Type &&
                   Confidence.Equals(other.Confidence) &&
                   Magnitude.Equals(other.Magnitude) &&
                   Period.Equals(other.Period));
        }
Beispiel #4
0
        public override bool Equals(object obj)
        {
            if (obj == null || GetType() != obj.GetType())
            {
                return(false);
            }

            var alertToComplete = (Alert)obj;

            if (AlertMessage == null)
            {
                if (alertToComplete.AlertMessage != null)
                {
                    return(false);
                }
            }
            else if (!AlertMessage.Equals(alertToComplete.AlertMessage))
            {
                return(false);
            }

            if (!Risk.Equals(alertToComplete.Risk))
            {
                return(false);
            }

            if (!Confidence.Equals(alertToComplete.Confidence))
            {
                return(false);
            }

            if (Url == null)
            {
                if (alertToComplete.Url != null)
                {
                    return(false);
                }
            }
            else if (!Url.Equals(alertToComplete.Url))
            {
                return(false);
            }

            if (Other == null)
            {
                if (alertToComplete.Other != null)
                {
                    return(false);
                }
            }
            else if (!Other.Equals(alertToComplete.Other))
            {
                return(false);
            }

            if (Parameter == null)
            {
                if (alertToComplete.Parameter != null)
                {
                    return(false);
                }
            }
            else if (!Parameter.Equals(alertToComplete.Parameter))
            {
                return(false);
            }

            if (Attack == null)
            {
                if (alertToComplete.Attack != null)
                {
                    return(false);
                }
            }
            else if (!Attack.Equals(alertToComplete.Attack))
            {
                return(false);
            }

            if (Evidence == null)
            {
                if (alertToComplete.Evidence != null)
                {
                    return(false);
                }
            }
            else if (!Evidence.Equals(alertToComplete.Evidence))
            {
                return(false);
            }

            if (Description == null)
            {
                if (alertToComplete.Description != null)
                {
                    return(false);
                }
            }
            else if (!Description.Equals(alertToComplete.Description))
            {
                return(false);
            }

            if (Reference == null)
            {
                if (alertToComplete.Reference != null)
                {
                    return(false);
                }
            }
            else if (!Reference.Equals(alertToComplete.Reference))
            {
                return(false);
            }

            if (Solution == null)
            {
                if (alertToComplete.Solution != null)
                {
                    return(false);
                }
            }
            else if (!Solution.Equals(alertToComplete.Solution))
            {
                return(false);
            }

            if (CweId != alertToComplete.CweId)
            {
                return(false);
            }

            if (WascId != alertToComplete.WascId)
            {
                return(false);
            }

            return(true);
        }