io.sphere.sdk.attributes.EnumAttributeDefinitionBuilder Maven / Gradle / Ivy
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);
}
}