io.sphere.sdk.models.Reference.hasSameIdAs()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(2.0k)|赞(0)|评价(0)|浏览(116)

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

Reference.hasSameIdAs介绍

暂无

代码示例

代码示例来源:origin: io.sphere.sdk.jvm/models

default List<ShippingRate> getShippingRatesForZone(final Referenceable<Zone> zone) {
  final Optional<ZoneRate> zoneRateOptional = getZoneRates().stream()
      .filter(rate -> rate.getZone().hasSameIdAs(zone.toReference()))
      .findFirst();
  return zoneRateOptional
      .map(rate -> rate.getShippingRates())
      .orElse(Collections.emptyList());
}

代码示例来源:origin: io.sphere.sdk.jvm/sphere-models

default List<ShippingRate> getShippingRatesForZone(final Referenceable<Zone> zone) {
  return getZoneRates().stream()
      .filter(rate -> rate.getZone().hasSameIdAs(zone.toReference()))
      .findFirst()
      .map(rate -> rate.getShippingRates())
      .orElse(Collections.emptyList());
}

代码示例来源:origin: com.commercetools.sdk.jvm.core/commercetools-models

default List<ShippingRate> getShippingRatesForZone(final Referenceable<Zone> zone) {
  return getZoneRates().stream()
      .filter(rate -> rate.getZone().hasSameIdAs(zone.toReference()))
      .findFirst()
      .map(rate -> rate.getShippingRates())
      .orElse(Collections.emptyList());
}

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

default List<ShippingRate> getShippingRatesForZone(final Referenceable<Zone> zone) {
  return getZoneRates().stream()
      .filter(rate -> rate.getZone().hasSameIdAs(zone.toReference()))
      .findFirst()
      .map(rate -> rate.getShippingRates())
      .orElse(Collections.emptyList());
}

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

withZone(client(), zone -> {
  withUpdateableShippingMethod(client(), shippingMethod -> {
    final long count = shippingMethod.getZones().stream().filter(z -> z.hasSameIdAs(zone)).count();
    assertThat(count).overridingErrorMessage("zone is not used yet").isEqualTo(0);
        .filter(rate -> rate.getZone().hasSameIdAs(zone))
        .findFirst()
        .get();

相关文章