gpt4 book ai didi

io.sphere.sdk.zones.ZoneDraft.of()方法的使用及代码示例

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

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

ZoneDraft.of介绍

暂无

代码示例

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

public static ZoneDraft of(final String name, final Set<Location> locations) {
  return of(name, locations, null);
}

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

public static ZoneDraft of(final String name, final Set<Location> locations, final String description) {
  return of(name, locations, Optional.of(description));
}

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

public static ZoneDraft of(final String name, final Set<Location> locations) {
  return of(name, locations, Optional.empty());
}

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

static ZoneDraft ofCountries(final String name, final Set<CountryCode> countries, @Nullable final String description) {
  final Set<Location> locations = countries.stream().map(country -> Location.of(country)).collect(toSet());
  return of(name, locations, description);
}

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

static ZoneDraft ofCountries(final String name, final Set<CountryCode> countries, @Nullable final String description) {
  final Set<Location> locations = countries.stream().map(country -> Location.of(country)).collect(toSet());
  return of(name, locations, description);
}

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

public static synchronized void withUpdateableZone(final BlockingSphereClient client, final Function<Zone, Zone> f, final Location location, final Location... moreLocations) {
  final Set<Location> locations = setOf(location, moreLocations);
  final ZoneDraft draft = ZoneDraft.of("zone " + location, locations, "Zone X");
  withUpdateableZone(client, draft, f);
}

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

public static void withUpdateableDynamicShippingMethodForGermany(final BlockingSphereClient client, final CartPredicate cartPredicate, final UnaryOperator<ShippingMethod> consumer) {
  final Optional<Zone> zoneOptional = client.executeBlocking(ZoneQuery.of().byCountry(DE)).head();
  final Zone zone;
  if (zoneOptional.isPresent()) {
    zone = zoneOptional.get();
  } else {
    zone = client.executeBlocking(ZoneCreateCommand.of(ZoneDraft.of("de", singleton(Location.of(DE)))));
  }
  withUpdateableDynamicShippingMethod(client, cartPredicate, shippingMethodWithOutZone -> {
    final ShippingMethod updated = client.executeBlocking(ShippingMethodUpdateCommand.of(shippingMethodWithOutZone, asList(AddZone.of(zone), AddShippingRate.of(ShippingRate.of(EURO_1), zone))));
    return consumer.apply(updated);
  });
}

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

public static void withUpdateableShippingMethodForGermany(final BlockingSphereClient client, final UnaryOperator<ShippingMethod> consumer) {
  final Optional<Zone> zoneOptional = client.executeBlocking(ZoneQuery.of().byCountry(DE)).head();
  final Zone zone;
  if (zoneOptional.isPresent()) {
    zone = zoneOptional.get();
  } else {
    zone = client.executeBlocking(ZoneCreateCommand.of(ZoneDraft.of("de", singleton(Location.of(DE)))));
  }
  withUpdateableShippingMethod(client, shippingMethodWithOutZone -> {
    final ShippingMethod updated = client.executeBlocking(ShippingMethodUpdateCommand.of(shippingMethodWithOutZone, asList(AddZone.of(zone), AddShippingRate.of(ShippingRate.of(EURO_1), zone))));
    return consumer.apply(updated);
  });
}

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