org.springframework.data.gemfire.examples.domain.Address.getCountry()方法的使用及代码示例

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

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

Address.getCountry介绍

[英]Returns the country.
[中]返回国家。

代码示例

代码示例来源: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

@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

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));
      }
  }
}

相关文章