001
002package com.commercetools.ml.models.common;
003
004import java.util.*;
005
006import io.vrap.rmf.base.client.Builder;
007import io.vrap.rmf.base.client.utils.Generated;
008
009/**
010 * ProductTypeReferenceBuilder
011 * <hr>
012 * Example to create an instance using the builder pattern
013 * <div class=code-example>
014 * <pre><code class='java'>
015 *     ProductTypeReference productTypeReference = ProductTypeReference.builder()
016 *             .id("{id}")
017 *             .build()
018 * </code></pre>
019 * </div>
020 */
021@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
022public class ProductTypeReferenceBuilder implements Builder<ProductTypeReference> {
023
024    private String id;
025
026    /**
027     *
028     */
029
030    public ProductTypeReferenceBuilder id(final String id) {
031        this.id = id;
032        return this;
033    }
034
035    public String getId() {
036        return this.id;
037    }
038
039    public ProductTypeReference build() {
040        Objects.requireNonNull(id, ProductTypeReference.class + ": id is missing");
041        return new ProductTypeReferenceImpl(id);
042    }
043
044    /**
045     * builds ProductTypeReference without checking for non null required values
046     */
047    public ProductTypeReference buildUnchecked() {
048        return new ProductTypeReferenceImpl(id);
049    }
050
051    public static ProductTypeReferenceBuilder of() {
052        return new ProductTypeReferenceBuilder();
053    }
054
055    public static ProductTypeReferenceBuilder of(final ProductTypeReference template) {
056        ProductTypeReferenceBuilder builder = new ProductTypeReferenceBuilder();
057        builder.id = template.getId();
058        return builder;
059    }
060
061}