001
002package com.commercetools.history.models.change_value;
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 * AttributeValue
019 */
020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
021public class AttributeValueImpl implements AttributeValue, ModelBase {
022
023    private String name;
024
025    private java.lang.Object value;
026
027    /**
028     * create instance with all properties
029     */
030    @JsonCreator
031    AttributeValueImpl(@JsonProperty("name") final String name, @JsonProperty("value") final java.lang.Object value) {
032        this.name = name;
033        this.value = value;
034    }
035
036    /**
037     * create empty instance
038     */
039    public AttributeValueImpl() {
040    }
041
042    /**
043     *  <p>Name of the Attribute set.</p>
044     */
045
046    public String getName() {
047        return this.name;
048    }
049
050    /**
051     *  <p>Value set for the Attribute determined by the AttributeType:</p>
052     *  <ul>
053     *   <li>For Enum Type and Localized Enum Type, <code>value</code> is the <code>key</code> of the Plain Enum Value or Localized Enum Value objects, or the complete objects.</li>
054     *   <li>For Localizable Text Type, <code>value</code> is the LocalizedString object.</li>
055     *   <li>For Money Type Attributes, <code>value</code> is the Money object.</li>
056     *   <li>For Set Type Attributes, <code>value</code> is the entire <code>set</code> object.</li>
057     *   <li>For Nested Type Attributes, <code>value</code> is the list of values of all Attributes of the nested Product.</li>
058     *   <li>For Reference Type Attributes, <code>value</code> is the Reference object.</li>
059     *  </ul>
060     */
061
062    public java.lang.Object getValue() {
063        return this.value;
064    }
065
066    public void setName(final String name) {
067        this.name = name;
068    }
069
070    public void setValue(final java.lang.Object value) {
071        this.value = value;
072    }
073
074    @Override
075    public boolean equals(Object o) {
076        if (this == o)
077            return true;
078
079        if (o == null || getClass() != o.getClass())
080            return false;
081
082        AttributeValueImpl that = (AttributeValueImpl) o;
083
084        return new EqualsBuilder().append(name, that.name)
085                .append(value, that.value)
086                .append(name, that.name)
087                .append(value, that.value)
088                .isEquals();
089    }
090
091    @Override
092    public int hashCode() {
093        return new HashCodeBuilder(17, 37).append(name).append(value).toHashCode();
094    }
095
096}