gpt4 book ai didi

io.sphere.sdk.shippingmethods.ZoneRateDraftBuilder类的使用及代码示例

转载 作者:知者 更新时间:2024-03-13 10:54:17 24 4
gpt4 key购买 nike

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

ZoneRateDraftBuilder介绍

[英]Builder for ZoneRateDraft.
[中]建筑商为你设计草图。

代码示例

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

public ZoneRateDraftDsl withShippingRates(final List<ShippingRate> shippingRates) {
 return newBuilder().shippingRates(shippingRates).build();
}

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

/**
 * Creates a new object initialized with the given values.
 *
 * @param zone initial value for the {@link ZoneRateDraft#getZone()} property
 * @param shippingRates initial value for the {@link ZoneRateDraft#getShippingRates()} property
 * @return new object initialized with the given values
 */
public static ZoneRateDraftBuilder of(final ResourceIdentifier<Zone> zone,
  final List<ShippingRate> shippingRates) {
 return new ZoneRateDraftBuilder(shippingRates, zone);
}

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

public ZoneRateDraftDsl withZone(final ResourceIdentifier<Zone> zone) {
 return newBuilder().zone(zone).build();
}

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

@Test
public void execution() throws Exception {
  final CurrencyUnit currencyUnit = USD;
  final TaxRateDraft taxRate = TaxRateDraft.of("x20", 0.20, true, COUNTRY_CODE);
  withZone(client(), zone -> {
    withTaxCategory(client(), TaxCategoryDraft.of("taxcat", asList(taxRate)), taxCategory -> {
      final ZoneRateDraft zoneRate = ZoneRateDraftBuilder.of(zone.toResourceIdentifier(), asList(ShippingRate.of(MoneyImpl.of(30, currencyUnit)))).build();
      final ShippingMethodDraft draft =
          ShippingMethodDraft.of("standard shipping", "description", taxCategory, asList(zoneRate));
      final ShippingMethod shippingMethod = client().executeBlocking(ShippingMethodCreateCommand.of(draft));
      //deletion
      client().executeBlocking(ShippingMethodDeleteCommand.of(shippingMethod));
    });
  }, COUNTRY_CODE);
}

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

@Test
public void createShippingMethodWithPredicate() throws Exception {
  final CurrencyUnit currencyUnit = USD;
  final TaxRateDraft taxRate = TaxRateDraft.of("x20", 0.20, true, COUNTRY_CODE);
  withZone(client(), zone -> {
    withTaxCategory(client(), TaxCategoryDraft.of("taxcat", asList(taxRate)), taxCategory -> {
      final ZoneRateDraft zoneRateDraft = ZoneRateDraftBuilder.of(zone.toResourceIdentifier(), asList(ShippingRate.of(MoneyImpl.of(30, currencyUnit)))).build();
      final ShippingMethodDraft draft =
          ShippingMethodDraftBuilder.of("standard shipping", "description", taxCategory.toReference(), asList(zoneRateDraft), false)
              .predicate(CartPredicate.of("customer.email = \"john@example.com\""))
              .build();
      final ShippingMethod shippingMethod = client().executeBlocking(ShippingMethodCreateCommand.of(draft));
      //deletion
      client().executeBlocking(ShippingMethodDeleteCommand.of(shippingMethod));
    });
  }, COUNTRY_CODE);
}

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

/**
 * Creates a new builder with the values of this object.
 *
 * @return new builder
 */
public ZoneRateDraftBuilder newBuilder() {
 return new ZoneRateDraftBuilder(shippingRates, zone);
}

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

/**
  * Creates a new object initialized with the fields of the template parameter.
  *
  * @param template the template
  * @return a new object initialized from the template
  */
 public static ZoneRateDraftBuilder of(final ZoneRateDraft template) {
  return new ZoneRateDraftBuilder(template.getShippingRates(), template.getZone());
 }
}

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