org.springframework.data.gemfire.examples.domain.Address类的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(5.7k)|赞(0)|评价(0)|浏览(117)

本文整理了Java中org.springframework.data.gemfire.examples.domain.Address类的一些代码示例,展示了Address类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Address类的具体详情如下:
包路径:org.springframework.data.gemfire.examples.domain.Address
类名称:Address

Address介绍

[英]An address.
[中]地址。

代码示例

代码示例来源:origin: spring-projects/spring-gemfire-examples

/**
 * Returns a copy of the current {@link Address} instance which is a new entity in terms of persistence.
 *
 * @return
 */
public Address getCopy() {
  return new Address(this.street, this.city, this.country);
}

代码示例来源:origin: spring-projects/spring-gemfire-examples

@SuppressWarnings("unchecked")
public static void main(String args[]) throws IOException {
   if (args.length >= 1 && args[0].equalsIgnoreCase("partitionByCountry")) {
      log.debug("partitioning by country");
      partitionByCountry = true;
  }
  @SuppressWarnings("resource")
  ApplicationContext context = new ClassPathXmlApplicationContext("client/cache-config.xml");
  Region<OrderKey,Order> region = context.getBean(Region.class);
  //Create some orders
  Random rand = new Random(new Date().getTime());
  for (long orderId = 1; orderId <= 100; orderId++) {
    Address shipTo = new Address("Some Street","Some City",(orderId%3 == 0)?"UK":"US");
    Order order = new Order(orderId, (new Long(rand.nextInt(100)+1)),shipTo);
    OrderKey orderKey = getOrderKey(orderId,shipTo.getCountry());
    region.put(orderKey, order);
  }
}

代码示例来源:origin: spring-projects/spring-gemfire-examples

@Override
  public String toString() {
    return String.format("%1$s, %2$s - %3$s", getStreet(), getCity(), getCountry());
  }
}

代码示例来源:origin: spring-projects/spring-gemfire-examples

private static Customer newCustomer(String firstName, String lastName) {
  Customer customer = new Customer(id.incrementAndGet(),
    new EmailAddress(String.format("%1$s.%2$s@home.com", firstName, lastName)), firstName, lastName);
  customer.add(new Address("100 Main St.", "Portland", "USA"));
  customerList.add(customer);
  return customer;
}

代码示例来源:origin: spring-projects/spring-gemfire-examples

private void findOrders() {
  log.debug("looking for orders for customer ID 2");
  
  for (Order order: orderService.findOrdersByCustomerId(2L)) {
    log.debug("found order ID " + order.getId() + " " + 
        order.getBillingAddress().getStreet() + " " + 
        order.getBillingAddress().getCity() + " " + 
        order.getBillingAddress().getCountry());
      for (LineItem lineItem: order.getLineItems()) {
        log.debug("product ID:" + lineItem.getProductId() + 
           " quantity:" + lineItem.getAmount() + 
           " unit price:" + lineItem.getUnitPrice().setScale(2,BigDecimal.ROUND_DOWN) + 
           " total price:" + lineItem.getTotal().setScale(2,BigDecimal.ROUND_DOWN));
      }
  }
}

代码示例来源:origin: spring-projects/spring-gemfire-examples

System.out.println("Press <Enter> to update region " + region.getName());
System.in.read();
region.put(id, new Order(1L, 1L, new Address("street", "city",
  "country")));
System.out.println("Press <Enter> to quit");

代码示例来源:origin: spring-projects/spring-gemfire-examples

@SuppressWarnings("unchecked")
  public static void main(String args[]) throws IOException {

    ApplicationContext context = new ClassPathXmlApplicationContext("consumer/cache-config.xml");
    Region<Long,Customer> region = context.getBean(Region.class);

    System.out.println("Please Start the Producer. Then press <Enter>");
    System.in.read();

    Customer dave = region.get(1L);
    if (dave != null) {
      log.debug("retrieved " + dave.getFirstname() + " " + dave.getLastname());
    }

    Customer alicia = region.get(2L);
    if (alicia !=null) {
      log.debug("retrieved " + alicia.getFirstname() + " " + alicia.getLastname());
      alicia.add(new Address("Keys Street","Alicia","UK"));
      region.put(alicia.getId(), alicia);
    }
  }
}

代码示例来源:origin: spring-projects/spring-gemfire-examples

macbook.setAttribute("warantee","included");
Order davesOrder = new Order(1L, dave.getId(),new Address("Dave Street","Matthews","USA"));
Order aliciasFirstOrder = new Order(2L, alicia.getId(),new Address("Alicia Street","Keys","USA"));
Order aliciasNextOrder = new Order(3L, alicia.getId(),new Address("Alicia Street","Keys","USA"));

代码示例来源:origin: spring-projects/spring-gemfire-examples

private void createOrders() {
  Customer dave = customerService.findByEmailAddress("dave@matthews.com");
  Order davesOrder = new Order(1L, dave.getId(),new Address("Dave Street","Matthews","USA"));
  Order aliciasFirstOrder = new Order(2L, alicia.getId(),new Address("Alicia Street","Keys","USA"));
  Order aliciasNextOrder = new Order(3L, alicia.getId(),new Address("Alicia Street","Keys","USA"));

代码示例来源:origin: spring-projects/spring-gemfire-examples

Address address = new Address("it","doesnt","matter");
for (long orderId = 1; orderId <= 100; orderId ++) {

代码示例来源:origin: spring-projects/spring-gemfire-examples

Address address = new Address("it","doesnt","matter");
for (long orderId = 1; orderId <= 100; orderId ++) {

代码示例来源:origin: spring-projects/spring-gemfire-examples

macbook.setAttribute("warantee", "included");
Order davesOrder = new Order(1L, 1L, new Address(
    "Dave Street", "Matthews", "USA"));
davesOrder.add(new LineItem(macbook));
Order aliciasFirstOrder = new Order(2L, 2L, new Address(
    "Alicia Street", "Keys", "USA"));
Order aliciasNextOrder = new Order(3L, 2L, new Address(
    "Alicia Street", "Keys", "USA"));

代码示例来源:origin: spring-projects/spring-gemfire-examples

Address address = new Address("it", "doesnt", "matter");

相关文章