001
002package com.commercetools.history.models.label;
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 * ProductLabel
019 */
020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
021public class ProductLabelImpl implements ProductLabel, ModelBase {
022
023    private String type;
024
025    private com.commercetools.history.models.common.LocalizedString slug;
026
027    private com.commercetools.history.models.common.LocalizedString name;
028
029    /**
030     * create instance with all properties
031     */
032    @JsonCreator
033    ProductLabelImpl(@JsonProperty("slug") final com.commercetools.history.models.common.LocalizedString slug,
034            @JsonProperty("name") final com.commercetools.history.models.common.LocalizedString name) {
035        this.slug = slug;
036        this.name = name;
037        this.type = PRODUCT_LABEL;
038    }
039
040    /**
041     * create empty instance
042     */
043    public ProductLabelImpl() {
044        this.type = PRODUCT_LABEL;
045    }
046
047    /**
048     *
049     */
050
051    public String getType() {
052        return this.type;
053    }
054
055    /**
056     *  <p>User-defined identifier used in a deep-link URL for the Product.</p>
057     */
058
059    public com.commercetools.history.models.common.LocalizedString getSlug() {
060        return this.slug;
061    }
062
063    /**
064     *  <p>Name of the Product.</p>
065     */
066
067    public com.commercetools.history.models.common.LocalizedString getName() {
068        return this.name;
069    }
070
071    public void setSlug(final com.commercetools.history.models.common.LocalizedString slug) {
072        this.slug = slug;
073    }
074
075    public void setName(final com.commercetools.history.models.common.LocalizedString name) {
076        this.name = name;
077    }
078
079    @Override
080    public boolean equals(Object o) {
081        if (this == o)
082            return true;
083
084        if (o == null || getClass() != o.getClass())
085            return false;
086
087        ProductLabelImpl that = (ProductLabelImpl) o;
088
089        return new EqualsBuilder().append(type, that.type)
090                .append(slug, that.slug)
091                .append(name, that.name)
092                .append(type, that.type)
093                .append(slug, that.slug)
094                .append(name, that.name)
095                .isEquals();
096    }
097
098    @Override
099    public int hashCode() {
100        return new HashCodeBuilder(17, 37).append(type).append(slug).append(name).toHashCode();
101    }
102
103}