本文整理汇总了Java中org.example.domain.Customer.setBillingAddress方法的典型用法代码示例。如果您正苦于以下问题:Java Customer.setBillingAddress方法的具体用法?Java Customer.setBillingAddress怎么用?Java Customer.setBillingAddress使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.example.domain.Customer
的用法示例。
在下文中一共展示了Customer.setBillingAddress方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createCustomer
import org.example.domain.Customer; //导入方法依赖的package包/类
public static Customer createCustomer(String name, String shippingStreet, String billingStreet, String annDate) {
Customer c = new Customer();
c.setName(name);
c.setStatus(Customer.Status.NEW);
if (annDate == null) {
annDate = "2010-04-14";
}
c.setAnniversary(Date.valueOf(annDate));
if (shippingStreet != null) {
Address shippingAddr = new Address();
shippingAddr.setLine1(shippingStreet);
shippingAddr.setLine2("Sandringham");
shippingAddr.setCity("Auckland");
shippingAddr.setCountry(Ebean.getReference(Country.class, "NZ"));
c.setShippingAddress(shippingAddr);
}
if (billingStreet != null) {
Address billingAddr = new Address();
billingAddr.setLine1(billingStreet);
billingAddr.setLine2("St Lukes");
billingAddr.setCity("Auckland");
billingAddr.setCountry(Ebean.getReference(Country.class, "NZ"));
c.setBillingAddress(billingAddr);
}
return c;
}
示例2: createCustomer
import org.example.domain.Customer; //导入方法依赖的package包/类
private static Customer createCustomer(String name, String shippingStreet, String billingStreet, int contactSuffix) {
Customer c = new Customer(name);
if (contactSuffix > 0) {
c.addContact(new Contact("Jim" + contactSuffix, "Cricket"));
c.addContact(new Contact("Fred" + contactSuffix, "Blue"));
c.addContact(new Contact("Bugs" + contactSuffix, "Bunny"));
}
if (shippingStreet != null) {
Address shippingAddr = new Address();
shippingAddr.setLine1(shippingStreet);
shippingAddr.setLine2("Sandringham");
shippingAddr.setCity("Auckland");
shippingAddr.setCountry(Country.find.ref("NZ"));
c.setShippingAddress(shippingAddr);
}
if (billingStreet != null) {
Address billingAddr = new Address();
billingAddr.setLine1(billingStreet);
billingAddr.setLine2("St Lukes");
billingAddr.setCity("Auckland");
billingAddr.setCountry(Ebean.getReference(Country.class, "NZ"));
c.setBillingAddress(billingAddr);
}
return c;
}
示例3: createCustomer
import org.example.domain.Customer; //导入方法依赖的package包/类
public static Customer createCustomer(String name, String shippingStreet, String billingStreet, int contactSuffix) {
Customer c = new Customer();
c.setName(name);
if (contactSuffix > 0) {
c.addContact(new Contact("Jim" + contactSuffix, "Cricket"));
c.addContact(new Contact("Fred" + contactSuffix, "Blue"));
c.addContact(new Contact("Bugs" + contactSuffix, "Bunny"));
}
if (shippingStreet != null) {
Address shippingAddr = new Address();
shippingAddr.setLine1(shippingStreet);
shippingAddr.setLine2("Sandringham");
shippingAddr.setCity("Auckland");
shippingAddr.setCountry(Ebean.getReference(Country.class, "NZ"));
c.setShippingAddress(shippingAddr);
}
if (billingStreet != null) {
Address billingAddr = new Address();
billingAddr.setLine1(billingStreet);
billingAddr.setLine2("St Lukes");
billingAddr.setCity("Auckland");
billingAddr.setCountry(Ebean.getReference(Country.class, "NZ"));
c.setBillingAddress(billingAddr);
}
return c;
}