本文整理了Java中io.sphere.sdk.zones.ZoneDraft
类的一些代码示例,展示了ZoneDraft
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZoneDraft
类的具体详情如下:
包路径:io.sphere.sdk.zones.ZoneDraft
类名称:ZoneDraft
暂无
代码示例来源: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 Optional<String> description) {
return new ZoneDraft(name, locations, description);
}
}
代码示例来源:origin: io.sphere.sdk.jvm/models
public static ZoneDraft ofCountries(final String name, final Set<CountryCode> countries, final String description) {
return ofCountries(name, countries, Optional.of(description));
}
代码示例来源: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 ZoneDraftBuilder of(final ZoneDraft template) {
return new ZoneDraftBuilder(template.getDescription(), template.getKey(), template.getLocations(), template.getName());
}
}
代码示例来源: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 ZoneDraftDsl of(final ZoneDraft template) {
return new ZoneDraftDsl(template.getDescription(), template.getKey(), template.getLocations(), template.getName());
}
}
代码示例来源: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/sphere-models
public static ZoneDraft of(final String name, final Set<Location> locations, @Nullable final String description) {
return new ZoneDraft(name, locations, description);
}
}
代码示例来源:origin: commercetools/commercetools-jvm-sdk
public static synchronized void withUpdateableZone(final BlockingSphereClient client, final Function<Zone, Zone> f, final CountryCode country, final CountryCode... moreCountries) {
final Set<CountryCode> countries = setOf(country, moreCountries);
final ZoneDraft draft = ZoneDraft.ofCountries("zone " + country, countries, "Zone X");
withUpdateableZone(client, draft, f);
}
代码示例来源:origin: io.sphere.sdk.jvm/models
public static ZoneDraft of(final String name, final Set<Location> locations) {
return of(name, locations, Optional.empty());
}
代码示例来源:origin: io.sphere.sdk.jvm/models
public static ZoneDraft ofCountries(final String name, final Set<CountryCode> countries, final Optional<String> description) {
final Set<Location> locations = countries.stream().map(country -> Location.of(country)).collect(toSet());
return new ZoneDraft(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: io.sphere.sdk.jvm/sphere-models
public 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 new ZoneDraft(name, locations, description);
}
代码示例来源: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
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);
});
}
内容来源于网络,如有侵权,请联系作者删除!