// DupType creates a copy of the given data type.
436262
func (d *dupper) DupType(t DataType) DataType {
	switch actual := t.(type) {
	case Primitive:
		return t
	case *Array:
		return &Array{ElemType: d.DupAttribute(actual.ElemType)}
	case Object:
		res := make(Object, len(actual))
		for n, att := range actual {
			res[n] = d.DupAttribute(att)
		}
		return res
	case *Hash:
		return &Hash{
			KeyType:  d.DupAttribute(actual.KeyType),
			ElemType: d.DupAttribute(actual.ElemType),
		}
	case *UserTypeDefinition:
		if u, ok := d.dts[actual.TypeName]; ok {
			return u
		}
		u := &UserTypeDefinition{
			TypeName: actual.TypeName,
		}
		d.dts[u.TypeName] = u
		u.AttributeDefinition = d.DupAttribute(actual.AttributeDefinition)
		return u
	case *MediaTypeDefinition:
		if m, ok := d.dmts[actual.Identifier]; ok {
			return m
		}
		m := &MediaTypeDefinition{
			Identifier: actual.Identifier,
			Links:      actual.Links,
			Views:      actual.Views,
			Resource:   actual.Resource,
		}
		d.dmts[actual.Identifier] = m
		m.UserTypeDefinition = d.DupUserType(actual.UserTypeDefinition)
		return m
	}
	panic("unknown type " + t.Name())
}
1295479
func (s *dupSkipper) Dup(v string) bool {
	if s.m == nil {
		s.m = make(map[string]bool)
	}
	if s.m[v] {
		return true
	}
	s.m[v] = true
	return false
}
173789
func (s *ValidateService) Type(typ ...string) *ValidateService {
	s.typ = append(s.typ, typ...)
	return s
}
786726
func parseType(def string) typeParserResult {
	parser := &typeParser{input: def}
	return parser.parse()
}
201905
func unPtrType(t reflect.Type) reflect.Type {
	if t.Kind() == reflect.Ptr {
		return t.Elem()
	}
	return t
}
487768
func (p *Parameter) DataType(typeName string) *Parameter {
	p.data.DataType = typeName
	return p
}
1321804
func (c *TsCell) GetDataType() string {
	var dType string
	switch {
	case c.cell.VarcharValue != nil:
		switch c.columnType {
		case riak_ts.TsColumnType_VARCHAR:
			dType = riak_ts.TsColumnType_VARCHAR.String()
		case riak_ts.TsColumnType_BLOB:
			dType = riak_ts.TsColumnType_BLOB.String()
		default:
			dType = riak_ts.TsColumnType_VARCHAR.String()
		}
	case c.cell.Sint64Value != nil:
		dType = riak_ts.TsColumnType_SINT64.String()
	case c.cell.TimestampValue != nil:
		dType = riak_ts.TsColumnType_TIMESTAMP.String()
	case c.cell.BooleanValue != nil:
		dType = riak_ts.TsColumnType_BOOLEAN.String()
	case c.cell.DoubleValue != nil:
		dType = riak_ts.TsColumnType_DOUBLE.String()
	}

	return dType
}
200242
func UnicodeType(str uint32) {
	cstr := C.uint(str)
	C.unicodeType(cstr)
}
1170520
func sameType(first, second ComponentOrHTML) bool {
	return reflect.TypeOf(first) == reflect.TypeOf(second)
}
1090299
func (b *IndexService) OpType(opType string) *IndexService {
	b.opType = opType
	return b
}
1310041
func (s *RelationalDatabaseParameter) SetDataType(v string) *RelationalDatabaseParameter {
	s.DataType = &v
	return s
}
286035
func (g *deepCopyGenerator) ReplaceType(pkgPath, name string, t interface{}) {
	g.replace[pkgPathNamePair{pkgPath, name}] = reflect.TypeOf(t)
}
462229
func (s *MultiTermvectorService) Type(typ string) *MultiTermvectorService {
	s.typ = typ
	return s
}
1359696
func dup(p []byte) []byte {
	q := make([]byte, len(p))
	copy(q, p)
	return q
}
1104957
func AddType(ext, mime string) types.Type {
	return types.NewType(ext, mime)
}
781514
func (bi *BinaryInfo) Type(offset dwarf.Offset) (godwarf.Type, error) {
	return godwarf.ReadType(bi.dwarf, offset, bi.typeCache)
}
700792
func (s *IndicesGetFieldMappingService) Type(types ...string) *IndicesGetFieldMappingService {
	s.typ = append(s.typ, types...)
	return s
}