io.sphere.sdk.attributes.SetAttributeDefinitionBuilder Maven / Gradle / Ivy
The newest version!
package io.sphere.sdk.attributes;
import io.sphere.sdk.models.Builder;
import io.sphere.sdk.models.LocalizedStrings;
public class SetAttributeDefinitionBuilder extends AttributeDefinitionBuilder implements Builder {
private final AttributeType elementType;
SetAttributeDefinitionBuilder(final String name, final LocalizedStrings 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 LocalizedStrings label, final AttributeType attributeType) {
return new SetAttributeDefinitionBuilder(name, label, attributeType);
}
}