func (condition *conditionCombination) Alias(alias string) Condition {
	condition.alias = &alias
	return condition
}
Alias sets a string alias for the given condition. It can later be used in Query.Set*Params() methods.
This is an invalid call on a combination of conditions and will result in an error.
package objectbox
import (
	"errors"
	"fmt"
)
type Condition interface {
	applyTo(qb *QueryBuilder, isRoot bool) (ConditionId, error)
	Alias(alias string) Condition
	As(alias *alias) Condition
}
type ConditionId = int32
const conditionIdFakeOrder = -1
const conditionIdFakeLink = -2
type conditionClosure struct {
	apply func(qb *QueryBuilder) (ConditionId, error)
	alias *string
}
func (condition *conditionClosure) applyTo(qb *QueryBuilder, isRoot bool) (ConditionId, error) {
	cid, err := condition.apply(qb)
	if err != nil {
		return 0, err
	}
	if condition.alias != nil {
		err = qb.Alias(*condition.alias)
		if err != nil {
			return 0, err
		}
	}
	return cid, nil
}
func (condition *conditionClosure) Alias(alias string) Condition {
	condition.alias = &alias
	return condition
}
func (condition *conditionClosure) As(alias *alias) Condition {
	condition.alias = alias.alias()
	return condition
}
type conditionCombination struct {
	or         bool  
	conditions []Condition
	alias      *string  
}
func (*conditionCombination) assertNoLinks(conditionIds []ConditionId) error {
	for _, cid := range conditionIds {
		if cid == conditionIdFakeLink {
			return errors.New("using Link inside Any/All is not supported")
		}
	}
	return nil
}
func (condition *conditionCombination) applyTo(qb *QueryBuilder, isRoot bool) (ConditionId, error) {
	if condition.alias != nil {
		return 0, fmt.Errorf("using Alias/As(\"%s\") on a combination of conditions is not supported", *condition.alias)
	}
	if len(condition.conditions) == 0 {
		return 0, nil
	} else if len(condition.conditions) == 1 {
		return condition.conditions[0].applyTo(qb, isRoot)
	}
	ids := make([]ConditionId, 0, len(condition.conditions))
	for _, sub := range condition.conditions {
		cid, err := sub.applyTo(qb, false)
		if err != nil {
			return 0, err
		}
		if cid != conditionIdFakeOrder {
			ids = append(ids, cid)
		}
	}
	if isRoot && !condition.or {
		return 0, nil
	}
	if err := condition.assertNoLinks(ids); err != nil {
		return 0, err
	}
	if condition.or {
		return qb.Any(ids)
	}
	return qb.All(ids)
}