func (b *SampleFJSONBuilder) Convert(orig *SampleF) (*SampleFJSON, error) {
	if orig == nil {
		return nil, nil
	}
	ret := &SampleFJSON{}
	for _, info := range b._properties {
		if err := info.Encoder(orig, ret); err != nil {
			return nil, err
		}
	}
	return ret, nil
}
Convert specified non-JSON object to JSON object.
package f
import (
	"encoding/json"
	"github.com/favclip/jwg/misc/fixture/a"
	bravo "github.com/favclip/jwg/misc/fixture/b"
)
type SampleFJSON struct {
	A *a.Sample     `json:"a,omitempty"`
	B *bravo.Sample `json:"b,omitempty"`
}
type SampleFJSONList []*SampleFJSON
type SampleFPropertyEncoder func(src *SampleF, dest *SampleFJSON) error
type SampleFPropertyDecoder func(src *SampleFJSON, dest *SampleF) error
type SampleFPropertyInfo struct {
	fieldName string
	jsonName  string
	Encoder   SampleFPropertyEncoder
	Decoder   SampleFPropertyDecoder
}
func (info *SampleFPropertyInfo) FieldName() string {
	return info.fieldName
}
func (info *SampleFPropertyInfo) JSONName() string {
	return info.jsonName
}
type SampleFJSONBuilder struct {
	_properties        map[string]*SampleFPropertyInfo
	_jsonPropertyMap   map[string]*SampleFPropertyInfo
	_structPropertyMap map[string]*SampleFPropertyInfo
	A                  *SampleFPropertyInfo
	B                  *SampleFPropertyInfo
}
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
}
func (b *SampleFJSONBuilder) Properties() []*SampleFPropertyInfo {
	return []*SampleFPropertyInfo{
		b.A,
		b.B,
	}
}
func (b *SampleFJSONBuilder) AddAll() *SampleFJSONBuilder {
	b._properties["A"] = b.A
	b._properties["B"] = b.B
	return b
}
func (b *SampleFJSONBuilder) Add(info *SampleFPropertyInfo) *SampleFJSONBuilder {
	b._properties[info.fieldName] = info
	return b
}
func (b *SampleFJSONBuilder) AddByJSONNames(names ...string) *SampleFJSONBuilder {
	for _, name := range names {
		info := b._jsonPropertyMap[name]
		if info == nil {
			continue
		}
		b._properties[info.fieldName] = info
	}
	return b
}
func (b *SampleFJSONBuilder) AddByNames(names ...string) *SampleFJSONBuilder {
	for _, name := range names {
		info := b._structPropertyMap[name]
		if info == nil {
			continue
		}
		b._properties[info.fieldName] = info
	}
	return b
}
func (b *SampleFJSONBuilder) Remove(info *SampleFPropertyInfo) *SampleFJSONBuilder {
	delete(b._properties, info.fieldName)
	return b
}
func (b *SampleFJSONBuilder) RemoveByJSONNames(names ...string) *SampleFJSONBuilder {
	for _, name := range names {
		info := b._jsonPropertyMap[name]
		if info == nil {
			continue
		}
		delete(b._properties, info.fieldName)
	}
	return b
}
func (b *SampleFJSONBuilder) RemoveByNames(names ...string) *SampleFJSONBuilder {
	for _, name := range names {
		info := b._structPropertyMap[name]
		if info == nil {
			continue
		}
		delete(b._properties, info.fieldName)
	}
	return b
}