本文整理了Java中io.sphere.sdk.shippingmethods.ZoneRate.getZone()
方法的一些代码示例,展示了ZoneRate.getZone()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZoneRate.getZone()
方法的具体详情如下:
包路径:io.sphere.sdk.shippingmethods.ZoneRate
类名称:ZoneRate
方法名:getZone
暂无
代码示例来源:origin: commercetools/commercetools-jvm-sdk
default List<Reference<Zone>> getZones() {
return getZoneRates().stream().map(rate -> rate.getZone()).collect(toList());
}
代码示例来源:origin: com.commercetools.sdk.jvm.core/commercetools-models
default List<Reference<Zone>> getZones() {
return getZoneRates().stream().map(rate -> rate.getZone()).collect(toList());
}
代码示例来源:origin: io.sphere.sdk.jvm/sphere-models
default List<Reference<Zone>> getZones() {
return getZoneRates().stream().map(rate -> rate.getZone()).collect(toList());
}
代码示例来源:origin: io.sphere.sdk.jvm/models
default List<Reference<Zone>> getZones() {
return getZoneRates().stream().map(rate -> rate.getZone()).collect(toList());
}
代码示例来源: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
@Test
public void createByJson() {
withTaxCategory(client(), taxCategory -> {
withZone(client(), zone -> {
final JsonNodeReferenceResolver referenceResolver = new JsonNodeReferenceResolver();
referenceResolver.addResourceByKey("standard-tax", taxCategory);
referenceResolver.addResourceByKey("zone-id", zone);
final ShippingMethodDraft draft = draftFromJsonResource("drafts-tests/shippingMethod.json", ShippingMethodDraft.class, referenceResolver);
withShippingMethod(client(), draft, shippingMethod -> {
assertThat(shippingMethod.getName()).isEqualTo("demo shipping method");
assertThat(shippingMethod.getTaxCategory()).isEqualTo(taxCategory.toReference());
final ZoneRate zoneRate = shippingMethod.getZoneRates().get(0);
assertThat(zoneRate.getZone()).isEqualTo(zone.toReference());
final ShippingRate shippingRate = zoneRate.getShippingRates().get(0);
assertThat(shippingRate.getPrice()).isEqualTo(EURO_20);
});
}, COUNTRY_CODE);
});
}
}
代码示例来源:origin: commercetools/commercetools-jvm-sdk
.filter(rate -> rate.getZone().hasSameIdAs(zone))
.findFirst()
.get();
.plusExpansionPaths(m -> m.zoneRates().zone());
final ShippingMethod loadedShippingMethod = client().executeBlocking(shippingMethodByIdGet);
assertThat(loadedShippingMethod.getZoneRates().get(0).getZone().getObj()).isNotNull();
assertThat(loadedShippingMethod.getZones().get(0).getObj())
.overridingErrorMessage("the convenience method also has expanded references").isNotNull();
代码示例来源:origin: commercetools/commercetools-jvm-sdk
final Reference<Zone> zone = zoneRate.getZone();
final ShippingMethod updatedShippingMethod = client().executeBlocking(ShippingMethodUpdateCommand.of(shippingMethod, asList(RemoveShippingRate.of(oldShippingRate, zone), AddShippingRate.of(ShippingRate.of(EURO_10, EURO_10), zone))));
内容来源于网络,如有侵权,请联系作者删除!