gpt4 book ai didi

io.sphere.sdk.zones.queries.ZoneQuery.byLocation()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-16 04:59:31 25 4
gpt4 key购买 nike

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

ZoneQuery.byLocation介绍

[英]Predicate which matches the country and state of a location. For ignoring the state use #byCountry(com.neovisionaries.i18n.CountryCode).
[中]匹配某个位置的国家和州的谓词。对于忽略州,请使用#byCountry(com.neovisionies.i18n.CountryCode)。

代码示例

代码示例来源:origin: com.commercetools.sunrise/common

private CompletionStage<Optional<Zone>> fetchZoneByCountry(final Location location) {
  final ZoneQuery request = ZoneQuery.of().byLocation(location);
  return sphereClient.execute(request)
      .thenApplyAsync(PagedResult::head);
}

代码示例来源:origin: commercetools/commercetools-jvm-sdk

private void locationCheck(final Location searchLocation, final Zone ... expected) {
    final PagedQueryResult<Zone> result = client().executeBlocking(ZoneQuery.of().byLocation(searchLocation));
    final Set<Zone> actual = new HashSet<>(result.getResults());
    assertThat(actual).isEqualTo(new HashSet<>(asList(expected)));
  }
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com