// Elements adds the provided elements to the fieldset.
549241
func (f *FieldSetType) Elements(elems ...FormElement) *FieldSetType {
	for _, e := range elems {
		t := reflect.TypeOf(e)
		switch {
		case t.Implements(reflect.TypeOf((*fields.FieldInterface)(nil)).Elem()):
			f.addField(e.(fields.FieldInterface))
		}
	}
	return f
}
827911
func (n NameIDFormat) Element() *etree.Element {
	el := etree.NewElement("")
	el.SetText(string(n))
	return el
}
1272991
func (set *StringSet) Add(element string) bool {
	_, found := set.set[element]
	set.set[element] = true
	return !found
}
752955
func (a *SubjectConfirmation) Element() *etree.Element {
	el := etree.NewElement("saml:SubjectConfirmation")
	el.CreateAttr("Method", a.Method)
	if a.NameID != nil {
		el.AddChild(a.NameID.Element())
	}
	if a.SubjectConfirmationData != nil {
		el.AddChild(a.SubjectConfirmationData.Element())
	}
	return el
}
4777
func (s *stringSet) All() []string {
	all := []string{}
	for v := range s.values {
		all = append(all, v)
	}
	return all
}
974049
func ElementsWithAttr(e Markup, f, val string) []Markup {
	return DeepElementsWithAttr(e, f, val, 1)
}
471258
func (f *Field) keys() bool {
	f.mu.RLock()
	defer f.mu.RUnlock()
	return f.options.Keys
}
600078
func (s *FieldCapsService) Fields(fields ...string) *FieldCapsService {
	s.fields = append(s.fields, fields...)
	return s
}
188219
func (s *Style) Apply(e *Element) {
	if e.allowStyles {
		e.styles = append(e.styles, s)
	}
}
359239
func (r *Record) AppendElements(list []interface{}) []interface{} {
	list = append(list, r.seq)
	for _, p := range r.pairs {
		list = append(list, p.k, p.v)
	}
	return list
}
766715
func (a *SubjectLocality) Element() *etree.Element {
	el := etree.NewElement("saml:SubjectLocality")
	if a.Address != "" {
		el.CreateAttr("Address", a.Address)
	}
	if a.DNSName != "" {
		el.CreateAttr("DNSName", a.DNSName)
	}
	return el
}
936133
func (set LiteralFieldSet) ContainsAll(i ...LiteralField) bool {
	for _, v := range i {
		if !set.Contains(v) {
			return false
		}
	}
	return true
}
524696
func (g *Grid) Add(e Element, x, y, colSpan, rowSpan int) {
	if x+colSpan > g.cols {
		g.cols = x + colSpan
	}
	if y+rowSpan > g.rows {
		g.rows = y + rowSpan
	}
	g.elts = append(g.elts, &gridElement{e, x, y, colSpan, rowSpan})
}
616512
func (q MoreLikeThisQuery) Fields(fields ...string) MoreLikeThisQuery {
	q.fields = append(q.fields, fields...)
	return q
}
51857
func (s *ExplainService) Fields(fields ...string) *ExplainService {
	s.fields = append(s.fields, fields...)
	return s
}
721367
func fieldSet(field *structs.Field, v string) error {
	switch f := field.Value().(type) {
	case flag.Value:
		if v := reflect.ValueOf(field.Value()); v.IsNil() {
			typ := v.Type()
			if typ.Kind() == reflect.Ptr {
				typ = typ.Elem()
			}

			if err := field.Set(reflect.New(typ).Interface()); err != nil {
				return err
			}

			f = field.Value().(flag.Value)
		}

		return f.Set(v)
	}

	// TODO: add support for other types
	switch field.Kind() {
	case reflect.Bool:
		val, err := strconv.ParseBool(v)
		if err != nil {
			return err
		}

		if err := field.Set(val); err != nil {
			return err
		}
	case reflect.Int:
		i, err := strconv.Atoi(v)
		if err != nil {
			return err
		}

		if err := field.Set(i); err != nil {
			return err
		}
	case reflect.String:
		if err := field.Set(v); err != nil {
			return err
		}
	case reflect.Slice:
		switch t := field.Value().(type) {
		case []string:
			if err := field.Set(strings.Split(v, ",")); err != nil {
				return err
			}
		case []int:
			var list []int
			for _, in := range strings.Split(v, ",") {
				i, err := strconv.Atoi(in)
				if err != nil {
					return err
				}

				list = append(list, i)
			}

			if err := field.Set(list); err != nil {
				return err
			}
		default:
			return fmt.Errorf("multiconfig: field '%s' of type slice is unsupported: %s (%T)",
				field.Name(), field.Kind(), t)
		}
	case reflect.Float64:
		f, err := strconv.ParseFloat(v, 64)
		if err != nil {
			return err
		}

		if err := field.Set(f); err != nil {
			return err
		}
	case reflect.Int64:
		switch t := field.Value().(type) {
		case time.Duration:
			d, err := time.ParseDuration(v)
			if err != nil {
				return err
			}

			if err := field.Set(d); err != nil {
				return err
			}
		case int64:
			p, err := strconv.ParseInt(v, 10, 0)
			if err != nil {
				return err
			}

			if err := field.Set(p); err != nil {
				return err
			}
		default:
			return fmt.Errorf("multiconfig: field '%s' of type int64 is unsupported: %s (%T)",
				field.Name(), field.Kind(), t)
		}

	default:
		return fmt.Errorf("multiconfig: field '%s' has unsupported type: %s", field.Name(), field.Kind())
	}

	return nil
}
923012
func (sm StatusDetail) Element() *etree.Element {
	el := etree.NewElement("samlp:StatusDetail")
	for _, child := range sm.Children {
		el.AddChild(child)
	}
	return el
}