本文整理了Java中io.sphere.sdk.models.Reference.hasSameIdAs
方法的一些代码示例,展示了Reference.hasSameIdAs
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Reference.hasSameIdAs
方法的具体详情如下:
包路径:io.sphere.sdk.models.Reference
类名称: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();
内容来源于网络,如有侵权,请联系作者删除!