func TestGetStructLike(t *testing.T) { b := FooBuilder.X(1).Y(2).Add(3).Add(4) s := builder.GetStructLike(b, Foo{}).(Foo) expected := Foo{X: 1, Y: 2, Add: []int{3, 4}} if !reflect.DeepEqual(s, expected) { t.Errorf("expected %v, got %v", expected, s) } }
func (b jsonBuilder) BuildReply() Reply { return builder.GetStructLike(b, Reply{}).(Reply) }
func (b jsonBuilder) BuildMessage() Message { return builder.GetStructLike(b, Message{}).(Message) }
func (b jsonBuilder) BuildCustomer() Customer { return builder.GetStructLike(b, Customer{}).(Customer) }
func (b jsonBuilder) AddDomain(value string) jsonBuilder { company := builder.GetStructLike(b, Company{}).(Company) company.AddDomain(value) return builder.Set(b, "Domains", company.Domains).(jsonBuilder) }
func (b jsonBuilder) AddPhoneNumber(value string, valueType string) jsonBuilder { customer := builder.GetStructLike(b, Customer{}).(Customer) customer.AddPhoneNumber(value, valueType) return builder.Set(b, "PhoneNumbers", customer.PhoneNumbers).(jsonBuilder) }
func (b jsonBuilder) BuildNote() Note { note := builder.GetStructLike(b, Note{}).(Note) note.InitializeResource(note) return note }
func (b jsonBuilder) BuildNote() Note { return builder.GetStructLike(b, Note{}).(Note) }
func (b jsonBuilder) BuildCompany() Company { return builder.GetStructLike(b, Company{}).(Company) }
func (b jsonBuilder) BuildCase() Case { cas := builder.GetStructLike(b, Case{}).(Case) cas.InitializeResource(cas) return cas }
func (b jsonBuilder) BuildReply() Reply { rep := builder.GetStructLike(b, Reply{}).(Reply) rep.InitializeResource(rep) return rep }
func (b jsonBuilder) BuildMessage() Message { msg := builder.GetStructLike(b, Message{}).(Message) msg.InitializeResource(msg) return msg }
func (b jsonBuilder) BuildCustomer() Customer { cust := builder.GetStructLike(b, Customer{}).(Customer) cust.InitializeResource(cust) return cust }
func (b jsonBuilder) BuildJob() Job { jb := builder.GetStructLike(b, Job{}).(Job) jb.InitializeResource(jb) return jb }
func (b jsonBuilder) BuildCompany() Company { cmp := builder.GetStructLike(b, Company{}).(Company) cmp.InitializeResource(cmp) return cmp }
func (b jsonBuilder) BuildCase() Case { return builder.GetStructLike(b, Case{}).(Case) }
func (b jsonBuilder) BuildDraft() Draft { return builder.GetStructLike(b, Draft{}).(Draft) }
func (b jsonBuilder) AddEmail(value string, valueType string) jsonBuilder { customer := builder.GetStructLike(b, Customer{}).(Customer) customer.AddEmail(value, valueType) return builder.Set(b, "Emails", customer.Emails).(jsonBuilder) }
func (b jsonBuilder) AddAddress(value string, valueType string) jsonBuilder { customer := builder.GetStructLike(b, Customer{}).(Customer) customer.AddAddress(value, valueType) return builder.Set(b, "Addresses", customer.Addresses).(jsonBuilder) }
func (b jsonBuilder) BuildDraft() Draft { dra := builder.GetStructLike(b, Draft{}).(Draft) dra.InitializeResource(dra) return dra }