package registry

//Batch helper to batch set properties
type Batch []*Entry

// MakeBatch creates a batch
func MakeBatch(params ...interface{}) Batch {
	ret := Batch{}
	for _, el := range params {
		switch v := el.(type) {
		case Batch:
			ret = append(ret, v...)
		case *Entry:
			ret = append(ret, v)
		}
	}
	return ret
}

//Tags set categories of the group
func (eg Batch) Tags(cat ...string) Batch {
	for _, e := range eg {
		e.Tags(cat...)
	}
	return eg
}

// DescInputs describe inputs
func (eg Batch) DescInputs(input ...string) Batch {
	for _, e := range eg {
		e.DescInputs(input...)
	}
	return eg

}

// DescOutput describe inputs
func (eg Batch) DescOutput(v string) Batch {
	for _, e := range eg {
		e.DescOutput(v)
	}
	return eg
}

// Extra set extras of the group
func (eg Batch) Extra(name string, value interface{}) Batch {
	for _, e := range eg {
		e.Extra(name, value)
	}
	return eg
}
