// AddByNames add properties to HogeJSONBuilder by struct property name. if name is not in the builder, it will ignore.
971256
func (b *HogeJSONBuilder) AddByNames(names ...string) *HogeJSONBuilder {
	for _, name := range names {
		info := b._structPropertyMap[name]
		if info == nil {
			continue
		}
		b._properties[info.fieldName] = info
	}
	return b
}
290210
func (m *DbMap) AddTableWithName(i interface{}, name string) *TableMap {
	return m.AddTableWithNameAndSchema(i, "", name)
}
413955
func (m *BaseMechanismManager) DisableByName(name string) error {
	mechanism, ok := m.Mechanisms.Get(name)
	if !ok {
		return ErrMechanismNotRegistered
	}

	if !mechanism.Enabled() {
		return nil
	}

	mechanism.Disable()
	atomic.StoreInt64(&m.activated, 0)
	atomic.StoreInt64(&m.enabled, 0)

	return nil
}
882580
func (c *Client) RegistrationByName(name string) (r contract.Registration, err error) {
	conn := c.Pool.Get()
	defer conn.Close()

	err = getObjectByHash(conn, db.ExportCollection+":name", name, unmarshalObject, &r)
	return r, err
}
145049
func (b *TodoJSONBuilder) Add(infos ...*TodoPropertyInfo) *TodoJSONBuilder {
	for _, info := range infos {
		b._properties[info.fieldName] = info
	}
	return b
}
632905
func (b *InnerJSONBuilder) Add(infos ...*InnerPropertyInfo) *InnerJSONBuilder {
	for _, info := range infos {
		b._properties[info.fieldName] = info
	}
	return b
}
25936
func (b *SampleJSONBuilder) AddAll() *SampleJSONBuilder {
	b._properties["A"] = b.A
	b._properties["B"] = b.B
	b._properties["C"] = b.C
	b._properties["D"] = b.D
	b._properties["E"] = b.E
	b._properties["F"] = b.F
	b._properties["G"] = b.G
	return b
}
202386
func AddHeaders(headers map[string]string) http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {
		h := w.Header()

		for name, value := range headers {
			h.Add(name, value)
		}
	}
}
501931
func PlanByName(s string) (pt PlanType, ok bool) {
	for i, v := range planName {
		if v == s {
			return PlanType(i), true
		}
	}
	return NumPlans, false
}
1028229
func (c *Config) InputNames() []string {
	var name []string
	for _, input := range c.Inputs {
		name = append(name, input.Config.Name)
	}
	return name
}
404097
func (si *StructInfo) PropNames(rv reflect.Value) []string {
	si.lock.RLock()
	defer si.lock.RUnlock()

	pnames := make([]string, 0, len(si.props))
	for pname, pinfo := range si.props {
		if pinfo.IsMaybe {
			fv := rv.FieldByName(pinfo.FieldName)
			mv := fv.MethodByName("Valid")
			out := mv.Call(nil)
			if !out[0].Bool() {
				continue
			}
		}

		pnames = append(pnames, pname)
	}
	return pnames
}
224787
func SortByName(plugins []Plugin) {
	byName := func(p1, p2 *Plugin) bool {
		return p1.Name < p2.Name
	}

	sortBy(byName).sort(plugins)
}
543451
func TypeByName(typeName string) Type {
	initOnce.Do(discoverTypes)
	return Type2(types[typeName])
}
530269
func (c *Config) OutputNames() []string {
	var name []string
	for _, output := range c.Outputs {
		name = append(name, output.Name)
	}
	return name
}
261537
func (m *Meta) BuildNames(c *packer.Core) []string {
	// TODO: test

	// Filter the "only"
	if len(m.CoreConfig.Only) > 0 {
		// Build a set of all the available names
		nameSet := make(map[string]struct{})
		for _, n := range c.BuildNames() {
			nameSet[n] = struct{}{}
		}

		// Build our result set which we pre-allocate some sane number
		result := make([]string, 0, len(m.CoreConfig.Only))
		for _, n := range m.CoreConfig.Only {
			if _, ok := nameSet[n]; ok {
				result = append(result, n)
			}
		}

		return result
	}

	// Filter the "except"
	if len(m.CoreConfig.Except) > 0 {
		// Build a set of the things we don't want
		nameSet := make(map[string]struct{})
		for _, n := range m.CoreConfig.Except {
			nameSet[n] = struct{}{}
		}

		// Build our result set which is the names of all builds except
		// those in the given set.
		names := c.BuildNames()
		result := make([]string, 0, len(names))
		for _, n := range names {
			if _, ok := nameSet[n]; !ok {
				result = append(result, n)
			}
		}
		return result
	}

	// We care about everything
	return c.BuildNames()
}
782514
func (t *Table) AddHeaders(headers ...interface{}) {
	t.headers = append(t.headers, headers...)
}
1197633
func (c *nameCoordinator) Add(names []string) {
	c.mu.Lock()
	for _, name := range names {
		c.names[strings.ToLower(name)] = struct{}{}
	}
	c.mu.Unlock()
}