io.sphere.sdk.attributes.ReferenceAttributeDefinitionBuilder Maven / Gradle / Ivy
package io.sphere.sdk.attributes;
import io.sphere.sdk.models.Builder;
import io.sphere.sdk.models.LocalizedString;
public class ReferenceAttributeDefinitionBuilder extends AttributeDefinitionBuilder implements Builder {
private final ReferenceType referenceType;
ReferenceAttributeDefinitionBuilder(final String name, final LocalizedString label, final ReferenceType referenceType) {
super(name, label);
this.referenceType = referenceType;
}
public static ReferenceAttributeDefinitionBuilder of(final String name, final LocalizedString label, final ReferenceType referenceType) {
return new ReferenceAttributeDefinitionBuilder(name, label, referenceType);
}
@Override
protected ReferenceAttributeDefinitionBuilder getThis() {
return this;
}
@Override
public ReferenceAttributeDefinition build() {
return new ReferenceAttributeDefinition(referenceType, getName(), getLabel(), isRequired(), getAttributeConstraint(), isSearchable());
}
}