All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.sphere.sdk.products.AttributeContainerDraft Maven / Gradle / Ivy

There is a newer version: 1.0.0-M26
Show newest version
package io.sphere.sdk.products;

import io.sphere.sdk.products.attributes.Attribute;
import io.sphere.sdk.products.attributes.AttributeDraft;

import java.util.List;

import static java.util.Arrays.asList;
import static java.util.stream.Collectors.toList;

public final class AttributeContainerDraft {
    private AttributeContainerDraft() {
    }

    public static AttributeContainer of(final AttributeDraft ... attributeDrafts) {
        return of(asList(attributeDrafts));
    }

    public static AttributeContainer of(final List attributeDrafts) {
        final List attributes = attributeDrafts.stream()
                .map(attributeDraft -> Attribute.of(attributeDraft.getName(), attributeDraft.getValue()))
                .collect(toList());
        return AttributeContainer.of(attributes);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy