001
002package com.commercetools.importapi.models.types;
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>Defines an allowed value of a CustomFieldEnumType field.</p>
019 */
020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
021public class CustomFieldEnumValueImpl implements CustomFieldEnumValue, ModelBase {
022
023    private String key;
024
025    private String label;
026
027    /**
028     * create instance with all properties
029     */
030    @JsonCreator
031    CustomFieldEnumValueImpl(@JsonProperty("key") final String key, @JsonProperty("label") final String label) {
032        this.key = key;
033        this.label = label;
034    }
035
036    /**
037     * create empty instance
038     */
039    public CustomFieldEnumValueImpl() {
040    }
041
042    /**
043     *  <p>Key of the value used as a programmatic identifier.</p>
044     */
045
046    public String getKey() {
047        return this.key;
048    }
049
050    /**
051     *  <p>Descriptive label of the value.</p>
052     */
053
054    public String getLabel() {
055        return this.label;
056    }
057
058    public void setKey(final String key) {
059        this.key = key;
060    }
061
062    public void setLabel(final String label) {
063        this.label = label;
064    }
065
066    @Override
067    public boolean equals(Object o) {
068        if (this == o)
069            return true;
070
071        if (o == null || getClass() != o.getClass())
072            return false;
073
074        CustomFieldEnumValueImpl that = (CustomFieldEnumValueImpl) o;
075
076        return new EqualsBuilder().append(key, that.key).append(label, that.label).isEquals();
077    }
078
079    @Override
080    public int hashCode() {
081        return new HashCodeBuilder(17, 37).append(key).append(label).toHashCode();
082    }
083
084}