// Conditionals
// ------------
// Equals creates an equals clause that can be used in conditional clauses.
//  table.Select().Where(table.C["id"].Equals(3))
195603
func (c ColumnElem) Equals(i interface{}) BinaryClause {
	// If the given parameter is a ColumnElem, wrap the post parameter
	// in a ColumnClause, not a Parameter
	switch t := i.(type) {
	case ColumnElem:
		return BinaryClause{
			Pre:  c,
			Post: t.clause(),
			Sep:  " = ",
		}
	default:
		return BinaryClause{
			Pre:  c,
			Post: &Parameter{i},
			Sep:  " = ",
		}
	}

}
557388
func (tag Tag) Equals(other DxfElement) bool {
	if otherTag, ok := other.(*Tag); ok {
		return tag.Code == otherTag.Code && tag.Value.Equals(otherTag.Value)
	}
	return false
}
1247444
func equals(a, b interface{}) bool {
	sameType := reflect.TypeOf(a) == reflect.TypeOf(b)
	if _, ok := a.([]byte); ok {
		if _, ok := b.([]byte); !ok {
			// panic(fmt.Sprintf("incomparable type: %v vs %v", a, b))
			return false
		}
		b1 := a.([]byte)
		b2 := b.([]byte)
		if len(b1) != len(b2) {
			return false
		}
		for i := 0; i < len(b1) && i < len(b2); i++ {
			if b1[i] != b2[i] {
				return false
			}
		}
		return true
	} else if _, ok := a.(int64); ok {
		if _, ok := b.(int64); !ok {
			// panic(fmt.Sprintf("incomparable type: %v vs %v", a, b))
			return false
		}
		return a.(int64) == b.(int64)
	} else if a == nil && b == nil {
		return true
	} else if sameType && a == b {
		return true
	}
	return false
}
491429
func (v *NestedListsI32x3) Equals(rhs *NestedListsI32x3) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.Integerlist == nil && rhs.Integerlist == nil) || (v.Integerlist != nil && rhs.Integerlist != nil && _List_List_List_I32_Equals(v.Integerlist, rhs.Integerlist))) {
		return false
	}

	return true
}
673092
func (v *GuessProtocolStruct) Equals(rhs *GuessProtocolStruct) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.MapField == nil && rhs.MapField == nil) || (v.MapField != nil && rhs.MapField != nil && _Map_String_String_Equals(v.MapField, rhs.MapField))) {
		return false
	}

	return true
}
427999
func (v *TApplicationException) Equals(rhs *TApplicationException) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !_String_EqualsPtr(v.Message, rhs.Message) {
		return false
	}
	if !_ExceptionType_EqualsPtr(v.Type, rhs.Type) {
		return false
	}

	return true
}
1016190
func (col *Column) Equal(_ sessionctx.Context, expr Expression) bool {
	if newCol, ok := expr.(*Column); ok {
		return newCol.UniqueID == col.UniqueID
	}
	return false
}
91483
func (c *Constraint) Equals(o *Constraint) bool {
	return c == o ||
		c.LTarget == o.LTarget &&
			c.RTarget == o.RTarget &&
			c.Operand == o.Operand
}
306204
func (l *Line) Equals(line *Line) bool {
	return (l.a.Equals(&line.a) && l.b.Equals(&line.b)) || (l.a.Equals(&line.b) && l.b.Equals(&line.a))
}
1365648
func (v *StructB) Equals(rhs *StructB) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.Aa == nil && rhs.Aa == nil) || (v.Aa != nil && rhs.Aa != nil && v.Aa.Equals(rhs.Aa))) {
		return false
	}
	if !v.Ab.Equals(rhs.Ab) {
		return false
	}

	return true
}
1053545
func (a *ServiceTemplate) Equals(b *ServiceTemplate) bool {
	if a.ID != b.ID {
		return false
	}
	if a.Name != b.Name {
		return false
	}
	if a.Version != b.Version {
		return false
	}
	if a.Description != b.Description {
		return false
	}
	if !reflect.DeepEqual(a.Services, b.Services) {
		return false
	}
	if !reflect.DeepEqual(a.ConfigFiles, b.ConfigFiles) {
		return false
	}
	return true
}
630197
func (lhs ModuleID) Equals(rhs ModuleID) bool {
	return ((int32)(lhs) == (int32)(rhs))
}
946619
func (v *ListTypeVersioningV1) Equals(rhs *ListTypeVersioningV1) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.Myints == nil && rhs.Myints == nil) || (v.Myints != nil && rhs.Myints != nil && _List_I32_Equals(v.Myints, rhs.Myints))) {
		return false
	}
	if !_String_EqualsPtr(v.Hello, rhs.Hello) {
		return false
	}

	return true
}
81484
func (v *OneField) Equals(rhs *OneField) bool {
	if v == nil {
		return rhs == nil
	} else if rhs == nil {
		return false
	}
	if !((v.Field == nil && rhs.Field == nil) || (v.Field != nil && rhs.Field != nil && v.Field.Equals(rhs.Field))) {
		return false
	}

	return true
}
959466
func (c *Card) Equals(o *Card) bool {
	if c.Suit == o.Suit && c.Value == o.Value {
		return true
	}
	return false
}
1109849
func (m *Matrix) Equals(t *Matrix) bool {
	if m.Rows != t.Rows || m.Cols != t.Cols {
		return false
	}
	ch := make(chan bool, m.Cols)
	for y := 0; y < int(m.Rows); y++ {
		go cmp(m.M[y], t.M[y], ch)
	}
	for y := 0; y < int(m.Rows); y++ {
		if res := <-ch; !res {
			return false
		}
	}
	return true
}
89205
func (a *Attempt_ID) Equals(o *Attempt_ID) bool {
	return a.Quest == o.Quest && a.Id == o.Id
}