All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.sphere.sdk.attributes.ReferenceAttributeDefinitionBuilder Maven / Gradle / Ivy

There is a newer version: 1.0.0-M7
Show newest version
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());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy