001
002package com.commercetools.api.models.type;
003
004import java.time.*;
005import java.util.*;
006
007import com.fasterxml.jackson.annotation.JsonCreator;
008import com.fasterxml.jackson.annotation.JsonProperty;
009import com.fasterxml.jackson.databind.annotation.*;
010
011import io.vrap.rmf.base.client.ModelBase;
012import io.vrap.rmf.base.client.utils.Generated;
013
014import org.apache.commons.lang3.builder.EqualsBuilder;
015import org.apache.commons.lang3.builder.HashCodeBuilder;
016
017/**
018 *  <p>The representation used when creating or updating a customizable data type with Custom Fields.</p>
019 */
020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
021public class CustomFieldsDraftImpl implements CustomFieldsDraft, ModelBase {
022
023    private com.commercetools.api.models.type.TypeResourceIdentifier type;
024
025    private com.commercetools.api.models.type.FieldContainer fields;
026
027    /**
028     * create instance with all properties
029     */
030    @JsonCreator
031    CustomFieldsDraftImpl(@JsonProperty("type") final com.commercetools.api.models.type.TypeResourceIdentifier type,
032            @JsonProperty("fields") final com.commercetools.api.models.type.FieldContainer fields) {
033        this.type = type;
034        this.fields = fields;
035    }
036
037    /**
038     * create empty instance
039     */
040    public CustomFieldsDraftImpl() {
041    }
042
043    /**
044     *  <p><code>id</code> or <code>key</code> of the Type.</p>
045     */
046
047    public com.commercetools.api.models.type.TypeResourceIdentifier getType() {
048        return this.type;
049    }
050
051    /**
052     *  <p>Object containing the Custom Fields for the customized resource or data type.</p>
053     */
054
055    public com.commercetools.api.models.type.FieldContainer getFields() {
056        return this.fields;
057    }
058
059    public void setType(final com.commercetools.api.models.type.TypeResourceIdentifier type) {
060        this.type = type;
061    }
062
063    public void setFields(final com.commercetools.api.models.type.FieldContainer fields) {
064        this.fields = fields;
065    }
066
067    @Override
068    public boolean equals(Object o) {
069        if (this == o)
070            return true;
071
072        if (o == null || getClass() != o.getClass())
073            return false;
074
075        CustomFieldsDraftImpl that = (CustomFieldsDraftImpl) o;
076
077        return new EqualsBuilder().append(type, that.type)
078                .append(fields, that.fields)
079                .append(type, that.type)
080                .append(fields, that.fields)
081                .isEquals();
082    }
083
084    @Override
085    public int hashCode() {
086        return new HashCodeBuilder(17, 37).append(type).append(fields).toHashCode();
087    }
088
089}