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

io.sphere.sdk.attributes.EnumAttributeDefinitionBuilder 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.LocalizedString;
import io.sphere.sdk.models.PlainEnumValue;

import java.util.List;


final public class EnumAttributeDefinitionBuilder extends BaseBuilder {

    private final List values;

    EnumAttributeDefinitionBuilder(final String name, final LocalizedString label, final List values) {
        super(name, label);
        this.values = values;
    }

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

    @Override
    public EnumAttributeDefinition build() {
        return new EnumAttributeDefinition(new EnumType(values), getName(), getLabel(), isRequired(), getAttributeConstraint(), isSearchable());
    }

    public static EnumAttributeDefinitionBuilder of(final String name, final LocalizedString label, final List values) {
        return new EnumAttributeDefinitionBuilder(name, label, values);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy