001
002package com.commercetools.history.models.change_value;
003
004import java.util.*;
005
006import io.vrap.rmf.base.client.Builder;
007import io.vrap.rmf.base.client.utils.Generated;
008
009/**
010 * ParcelChangeValueBuilder
011 * <hr>
012 * Example to create an instance using the builder pattern
013 * <div class=code-example>
014 * <pre><code class='java'>
015 *     ParcelChangeValue parcelChangeValue = ParcelChangeValue.builder()
016 *             .id("{id}")
017 *             .createdAt("{createdAt}")
018 *             .build()
019 * </code></pre>
020 * </div>
021 */
022@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
023public class ParcelChangeValueBuilder implements Builder<ParcelChangeValue> {
024
025    private String id;
026
027    private String createdAt;
028
029    /**
030     *  <p><code>id</code> of the Parcel.</p>
031     * @param id value to be set
032     * @return Builder
033     */
034
035    public ParcelChangeValueBuilder id(final String id) {
036        this.id = id;
037        return this;
038    }
039
040    /**
041     *  <p>Date and time (UTC) the Parcel was created.</p>
042     * @param createdAt value to be set
043     * @return Builder
044     */
045
046    public ParcelChangeValueBuilder createdAt(final String createdAt) {
047        this.createdAt = createdAt;
048        return this;
049    }
050
051    /**
052     *  <p><code>id</code> of the Parcel.</p>
053     * @return id
054     */
055
056    public String getId() {
057        return this.id;
058    }
059
060    /**
061     *  <p>Date and time (UTC) the Parcel was created.</p>
062     * @return createdAt
063     */
064
065    public String getCreatedAt() {
066        return this.createdAt;
067    }
068
069    /**
070     * builds ParcelChangeValue with checking for non-null required values
071     * @return ParcelChangeValue
072     */
073    public ParcelChangeValue build() {
074        Objects.requireNonNull(id, ParcelChangeValue.class + ": id is missing");
075        Objects.requireNonNull(createdAt, ParcelChangeValue.class + ": createdAt is missing");
076        return new ParcelChangeValueImpl(id, createdAt);
077    }
078
079    /**
080     * builds ParcelChangeValue without checking for non-null required values
081     * @return ParcelChangeValue
082     */
083    public ParcelChangeValue buildUnchecked() {
084        return new ParcelChangeValueImpl(id, createdAt);
085    }
086
087    /**
088     * factory method for an instance of ParcelChangeValueBuilder
089     * @return builder
090     */
091    public static ParcelChangeValueBuilder of() {
092        return new ParcelChangeValueBuilder();
093    }
094
095    /**
096     * create builder for ParcelChangeValue instance
097     * @param template instance with prefilled values for the builder
098     * @return builder
099     */
100    public static ParcelChangeValueBuilder of(final ParcelChangeValue template) {
101        ParcelChangeValueBuilder builder = new ParcelChangeValueBuilder();
102        builder.id = template.getId();
103        builder.createdAt = template.getCreatedAt();
104        return builder;
105    }
106
107}