package grmi

import "log"

type Predicate struct {
	ColumnName    string
	PredicateType func(Predicate) (string, error)
	Values        []interface{}
}

func NewPredicate(columnName string, predicateType func(Predicate) (string, error), values []interface{}) Predicate {
	return Predicate{columnName, predicateType, values}
}

func (self *Predicate) Build() string {
	result, err := self.PredicateType(*self)
	if err != nil {
		log.Println(err.Error())
	}
	return result
}
