// Add specified property to SampleJSONBuilder.
540064
func (b *SampleJSONBuilder) Add(info *SamplePropertyInfo) *SampleJSONBuilder {
	b._properties[info.fieldName] = info
	return b
}
363205
func NewSampleFJSONBuilder() *SampleFJSONBuilder {
	jb := &SampleFJSONBuilder{
		_properties:        map[string]*SampleFPropertyInfo{},
		_jsonPropertyMap:   map[string]*SampleFPropertyInfo{},
		_structPropertyMap: map[string]*SampleFPropertyInfo{},
		A: &SampleFPropertyInfo{
			fieldName: "A",
			jsonName:  "a",
			Encoder: func(src *SampleF, dest *SampleFJSON) error {
				if src == nil {
					return nil
				}
				dest.A = src.A
				return nil
			},
			Decoder: func(src *SampleFJSON, dest *SampleF) error {
				if src == nil {
					return nil
				}
				dest.A = src.A
				return nil
			},
		},
		B: &SampleFPropertyInfo{
			fieldName: "B",
			jsonName:  "b",
			Encoder: func(src *SampleF, dest *SampleFJSON) error {
				if src == nil {
					return nil
				}
				dest.B = src.B
				return nil
			},
			Decoder: func(src *SampleFJSON, dest *SampleF) error {
				if src == nil {
					return nil
				}
				dest.B = src.B
				return nil
			},
		},
	}
	jb._structPropertyMap["A"] = jb.A
	jb._jsonPropertyMap["a"] = jb.A
	jb._structPropertyMap["B"] = jb.B
	jb._jsonPropertyMap["b"] = jb.B
	return jb
}
837512
func NewSampleQueryBuilderWithKind(kind string) *SampleQueryBuilder {
	q := datastore.NewQuery(kind)
	bldr := &SampleQueryBuilder{q: q}
	bldr.Kind = &SampleQueryProperty{
		bldr: bldr,
		name: "Kind",
	}
	bldr.Foo = &SampleQueryProperty{
		bldr: bldr,
		name: "Foo",
	}

	if plugger, ok := interface{}(bldr).(Plugger); ok {
		bldr.plugin = plugger.Plugin()
		bldr.plugin.Init("Sample")
	}

	return bldr
}
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
}
1333036
func (b *SampleJSONBuilder) Convert(orig *Sample) (*SampleJSON, error) {
	if orig == nil {
		return nil, nil
	}
	ret := &SampleJSON{}

	for _, info := range b._properties {
		if err := info.Encoder(orig, ret); err != nil {
			return nil, err
		}
	}

	return ret, nil
}
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
}
485418
func (p *Properties) AddProperty(key string, value interface{}) {
	p.Property[key] = value
}
66877
func NewSampleJSONBuilder() *SampleJSONBuilder {
	jb := &SampleJSONBuilder{
		_properties:        map[string]*SamplePropertyInfo{},
		_jsonPropertyMap:   map[string]*SamplePropertyInfo{},
		_structPropertyMap: map[string]*SamplePropertyInfo{},
		A: &SamplePropertyInfo{
			fieldName: "A",
			jsonName:  "foo!",
			Encoder: func(src *Sample, dest *SampleJSON) error {
				if src == nil {
					return nil
				}
				dest.A = src.A
				return nil
			},
			Decoder: func(src *SampleJSON, dest *Sample) error {
				if src == nil {
					return nil
				}
				dest.A = src.A
				return nil
			},
		},
		B: &SamplePropertyInfo{
			fieldName: "B",
			jsonName:  "b",
			Encoder: func(src *Sample, dest *SampleJSON) error {
				if src == nil {
					return nil
				}
				dest.B = src.B
				return nil
			},
			Decoder: func(src *SampleJSON, dest *Sample) error {
				if src == nil {
					return nil
				}
				dest.B = src.B
				return nil
			},
		},
		C: &SamplePropertyInfo{
			fieldName: "C",
			jsonName:  "c",
			Encoder: func(src *Sample, dest *SampleJSON) error {
				if src == nil {
					return nil
				}
				dest.C = src.C
				return nil
			},
			Decoder: func(src *SampleJSON, dest *Sample) error {
				if src == nil {
					return nil
				}
				dest.C = src.C
				return nil
			},
		},
		D: &SamplePropertyInfo{
			fieldName: "D",
			jsonName:  "d",
			Encoder: func(src *Sample, dest *SampleJSON) error {
				if src == nil {
					return nil
				}
				dest.D = src.D
				return nil
			},
			Decoder: func(src *SampleJSON, dest *Sample) error {
				if src == nil {
					return nil
				}
				dest.D = src.D
				return nil
			},
		},
		F: &SamplePropertyInfo{
			fieldName: "F",
			jsonName:  "f",
			Encoder: func(src *Sample, dest *SampleJSON) error {
				if src == nil {
					return nil
				}
				dest.F = src.F
				return nil
			},
			Decoder: func(src *SampleJSON, dest *Sample) error {
				if src == nil {
					return nil
				}
				dest.F = src.F
				return nil
			},
		},
		G: &SamplePropertyInfo{
			fieldName: "G",
			jsonName:  "g",
			Encoder: func(src *Sample, dest *SampleJSON) error {
				if src == nil {
					return nil
				}
				dest.G = src.G
				return nil
			},
			Decoder: func(src *SampleJSON, dest *Sample) error {
				if src == nil {
					return nil
				}
				dest.G = src.G
				return nil
			},
		},
	}
	jb._structPropertyMap["A"] = jb.A
	jb._jsonPropertyMap["foo!"] = jb.A
	jb._structPropertyMap["B"] = jb.B
	jb._jsonPropertyMap["b"] = jb.B
	jb._structPropertyMap["C"] = jb.C
	jb._jsonPropertyMap["c"] = jb.C
	jb._structPropertyMap["D"] = jb.D
	jb._jsonPropertyMap["d"] = jb.D
	jb._structPropertyMap["F"] = jb.F
	jb._jsonPropertyMap["f"] = jb.F
	jb._structPropertyMap["G"] = jb.G
	jb._jsonPropertyMap["g"] = jb.G
	return jb
}
767767
func (p *SampleQueryProperty) Filter(op string, value interface{}) *SampleQueryBuilder {
	switch op {
	case "<=":
		p.LessThanOrEqual(value)
	case ">=":
		p.GreaterThanOrEqual(value)
	case "<":
		p.LessThan(value)
	case ">":
		p.GreaterThan(value)
	case "=":
		p.Equal(value)
	default:
		p.bldr.q = p.bldr.q.Filter(p.name+" "+op, value) // error raised by native query
	}
	if p.bldr.plugin != nil {
		p.bldr.plugin.Filter(p.name, op, value)
	}
	return p.bldr
}
101548
func (b *HogeJSONBuilder) AddByJSONNames(names ...string) *HogeJSONBuilder {
	for _, name := range names {
		info := b._jsonPropertyMap[name]
		if info == nil {
			continue
		}
		b._properties[info.fieldName] = info
	}
	return b
}
1058016
func (b *PeopleJSONBuilder) Add(info *PeoplePropertyInfo) *PeopleJSONBuilder {
	b._properties[info.fieldName] = info
	return b
}
542055
func (b *PeopleJSONBuilder) AddAll() *PeopleJSONBuilder {
	b._properties["ShowPrivateInfo"] = b.ShowPrivateInfo
	b._properties["List"] = b.List
	return b
}
370451
func (service *BaseService) AddInstanceMethods(obj interface{}, option ...Options) Service {
	service.methodManager.AddInstanceMethods(obj, option...)
	return service
}
118810
func (b *SampleFJSONBuilder) AddAll() *SampleFJSONBuilder {
	b._properties["A"] = b.A
	b._properties["B"] = b.B
	return b
}
714152
func (s *Schema) AddProperty(name string, property *Schema) {
	*s.Properties = append(*s.Properties, NewNamedSchema(name, property))
}
1294597
func jsonProperties(f reflect.StructField) *proto.Properties {
	var prop proto.Properties
	prop.Init(f.Type, f.Name, f.Tag.Get("protobuf"), &f)
	return &prop
}
145049
func (b *TodoJSONBuilder) Add(infos ...*TodoPropertyInfo) *TodoJSONBuilder {
	for _, info := range infos {
		b._properties[info.fieldName] = info
	}
	return b
}