Esempio n. 1
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 virtual bool Equals(IJsonSchema other)
        {
            var schema = other as JsonSchema04;

            if (ReferenceEquals(null, schema))
            {
                return(false);
            }
            if (ReferenceEquals(this, schema))
            {
                return(true);
            }
            if (Id != schema.Id)
            {
                return(false);
            }
            if (Schema != schema.Schema)
            {
                return(false);
            }
            if (Title != schema.Title)
            {
                return(false);
            }
            if (Description != schema.Description)
            {
                return(false);
            }
            if (!Equals(Default, schema.Default))
            {
                return(false);
            }
            if (MultipleOf != schema.MultipleOf)
            {
                return(false);
            }
            if (Maximum != schema.Maximum)
            {
                return(false);
            }
            if (ExclusiveMaximum != schema.ExclusiveMaximum)
            {
                return(false);
            }
            if (Minimum != schema.Minimum)
            {
                return(false);
            }
            if (ExclusiveMinimum != schema.ExclusiveMinimum)
            {
                return(false);
            }
            if (MaxLength != schema.MaxLength)
            {
                return(false);
            }
            if (MinLength != schema.MinLength)
            {
                return(false);
            }
            if (Pattern != schema.Pattern)
            {
                return(false);
            }
            if (!Equals(AdditionalItems, schema.AdditionalItems))
            {
                return(false);
            }
            if (!Equals(Items, schema.Items))
            {
                return(false);
            }
            if (MaxItems != schema.MaxItems)
            {
                return(false);
            }
            if (MinItems != schema.MinItems)
            {
                return(false);
            }
            if (UniqueItems != schema.UniqueItems)
            {
                return(false);
            }
            if (!Equals(AdditionalProperties, schema.AdditionalProperties))
            {
                return(false);
            }
            if (!Definitions.ContentsEqual(schema.Definitions))
            {
                return(false);
            }
            if (!Properties.ContentsEqual(schema.Properties))
            {
                return(false);
            }
            if (!PatternProperties.ContentsEqual(PatternProperties))
            {
                return(false);
            }
            if (!Dependencies.ContentsEqual(schema.Dependencies))
            {
                return(false);
            }
            if (!Enum.ContentsEqual(schema.Enum))
            {
                return(false);
            }
            if (!Equals(Type, schema.Type))
            {
                return(false);
            }
            if (!AllOf.ContentsEqual(schema.AllOf))
            {
                return(false);
            }
            if (!AnyOf.ContentsEqual(schema.AnyOf))
            {
                return(false);
            }
            if (!OneOf.ContentsEqual(schema.OneOf))
            {
                return(false);
            }
            if (!Equals(Not, schema.Not))
            {
                return(false);
            }
            if (!Equals(Format, schema.Format))
            {
                return(false);
            }
            if (!Required.ContentsEqual(schema.Required))
            {
                return(false);
            }
            return(Dependencies.ContentsEqual(schema.Dependencies));
        }