io.sphere.sdk.attributes.ReferenceAttributeDefinitionBuilder 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 ReferenceAttributeDefinitionBuilder extends AttributeDefinitionBuilder implements Builder {
private final ReferenceType referenceType;
ReferenceAttributeDefinitionBuilder(final String name, final LocalizedStrings label, final ReferenceType referenceType) {
super(name, label);
this.referenceType = referenceType;
}
public static ReferenceAttributeDefinitionBuilder of(final String name, final LocalizedStrings 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());
}
}