io.sphere.sdk.zones.ZoneDraft Maven / Gradle / Ivy
package io.sphere.sdk.zones;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.neovisionaries.i18n.CountryCode;
import javax.annotation.Nullable;
import java.util.Set;
import static java.util.stream.Collectors.toSet;
@JsonDeserialize(as = ZoneDraftImpl.class)
public interface ZoneDraft {
@Nullable
String getDescription();
Set getLocations();
String getName();
static ZoneDraft ofCountries(final String name, final Set countries, @Nullable final String description) {
final Set locations = countries.stream().map(country -> Location.of(country)).collect(toSet());
return new ZoneDraftImpl(name, locations, description);
}
static ZoneDraft of(final String name, final Set locations, @Nullable final String description) {
return new ZoneDraftImpl(name, locations, description);
}
static ZoneDraft of(final String name, final Set locations) {
return of(name, locations, null);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy