001
002package com.commercetools.history.models.common;
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 * FieldDefinition
019 */
020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
021public class FieldDefinitionImpl implements FieldDefinition, ModelBase {
022
023    private com.commercetools.history.models.common.FieldType type;
024
025    private String name;
026
027    private com.commercetools.history.models.common.LocalizedString label;
028
029    private com.commercetools.history.models.common.TextInputHint inputHint;
030
031    /**
032     * create instance with all properties
033     */
034    @JsonCreator
035    FieldDefinitionImpl(@JsonProperty("type") final com.commercetools.history.models.common.FieldType type,
036            @JsonProperty("name") final String name,
037            @JsonProperty("label") final com.commercetools.history.models.common.LocalizedString label,
038            @JsonProperty("inputHint") final com.commercetools.history.models.common.TextInputHint inputHint) {
039        this.type = type;
040        this.name = name;
041        this.label = label;
042        this.inputHint = inputHint;
043    }
044
045    /**
046     * create empty instance
047     */
048    public FieldDefinitionImpl() {
049    }
050
051    /**
052     *
053     */
054
055    public com.commercetools.history.models.common.FieldType getType() {
056        return this.type;
057    }
058
059    /**
060     *  <p>The name of the field. The name must be between two and 36 characters long and can contain the ASCII letters A to Z in lowercase or uppercase, digits, underscores (<code>_</code>) and the hyphen-minus (<code>-</code>). The name must be unique for a given resource type ID. In case there is a field with the same name in another type it has to have the same FieldType also.</p>
061     */
062
063    public String getName() {
064        return this.name;
065    }
066
067    /**
068     *
069     */
070
071    public com.commercetools.history.models.common.LocalizedString getLabel() {
072        return this.label;
073    }
074
075    /**
076     *
077     */
078
079    public com.commercetools.history.models.common.TextInputHint getInputHint() {
080        return this.inputHint;
081    }
082
083    public void setType(final com.commercetools.history.models.common.FieldType type) {
084        this.type = type;
085    }
086
087    public void setName(final String name) {
088        this.name = name;
089    }
090
091    public void setLabel(final com.commercetools.history.models.common.LocalizedString label) {
092        this.label = label;
093    }
094
095    public void setInputHint(final com.commercetools.history.models.common.TextInputHint inputHint) {
096        this.inputHint = inputHint;
097    }
098
099    @Override
100    public boolean equals(Object o) {
101        if (this == o)
102            return true;
103
104        if (o == null || getClass() != o.getClass())
105            return false;
106
107        FieldDefinitionImpl that = (FieldDefinitionImpl) o;
108
109        return new EqualsBuilder().append(type, that.type)
110                .append(name, that.name)
111                .append(label, that.label)
112                .append(inputHint, that.inputHint)
113                .append(type, that.type)
114                .append(name, that.name)
115                .append(label, that.label)
116                .append(inputHint, that.inputHint)
117                .isEquals();
118    }
119
120    @Override
121    public int hashCode() {
122        return new HashCodeBuilder(17, 37).append(type).append(name).append(label).append(inputHint).toHashCode();
123    }
124
125}