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

io.sphere.sdk.attributes.SetAttributeDefinitionBuilder Maven / Gradle / Ivy

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

import io.sphere.sdk.models.Builder;
import io.sphere.sdk.models.LocalizedString;

public class SetAttributeDefinitionBuilder extends AttributeDefinitionBuilder implements Builder {
    private final AttributeType elementType;

    SetAttributeDefinitionBuilder(final String name, final LocalizedString label, final AttributeType elementType) {
        super(name, label);
        this.elementType = elementType;
    }

    @Override
    protected SetAttributeDefinitionBuilder getThis() {
        return this;
    }

    @Override
    public SetAttributeDefinition build() {
        return new SetAttributeDefinition(new SetType(elementType), getName(), getLabel(), getAttributeConstraint());
    }

    public static SetAttributeDefinitionBuilder of(final String name, final LocalizedString label, final AttributeType attributeType) {
        return new SetAttributeDefinitionBuilder(name, label, attributeType);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy