io.sphere.sdk.attributes.EnumAttributeDefinitionBuilder Maven / Gradle / Ivy
The newest version!
package io.sphere.sdk.attributes;
import io.sphere.sdk.models.LocalizedStrings;
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 LocalizedStrings 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 LocalizedStrings label, final List values) {
return new EnumAttributeDefinitionBuilder(name, label, values);
}
}