001
002package com.commercetools.importapi.models.productvariants;
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>This type represents an attribute whose value is set of boolean values.</p>
019 */
020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
021public class BooleanSetAttributeImpl implements BooleanSetAttribute, ModelBase {
022
023    private String name;
024
025    private String type;
026
027    private java.util.List<Boolean> value;
028
029    /**
030     * create instance with all properties
031     */
032    @JsonCreator
033    BooleanSetAttributeImpl(@JsonProperty("name") final String name,
034            @JsonProperty("value") final java.util.List<Boolean> value) {
035        this.name = name;
036        this.value = value;
037        this.type = BOOLEAN_SET;
038    }
039
040    /**
041     * create empty instance
042     */
043    public BooleanSetAttributeImpl() {
044        this.type = BOOLEAN_SET;
045    }
046
047    /**
048     *  <p>The name of this attribute must match a name of the product types attribute definitions. The name is required if this type is used in a product variant and must not be set when used in a product variant patch.</p>
049     */
050
051    public String getName() {
052        return this.name;
053    }
054
055    /**
056     *
057     */
058
059    public String getType() {
060        return this.type;
061    }
062
063    /**
064     *
065     */
066
067    public java.util.List<Boolean> getValue() {
068        return this.value;
069    }
070
071    public void setName(final String name) {
072        this.name = name;
073    }
074
075    public void setValue(final Boolean... value) {
076        this.value = new ArrayList<>(Arrays.asList(value));
077    }
078
079    public void setValue(final java.util.List<Boolean> value) {
080        this.value = value;
081    }
082
083    @Override
084    public boolean equals(Object o) {
085        if (this == o)
086            return true;
087
088        if (o == null || getClass() != o.getClass())
089            return false;
090
091        BooleanSetAttributeImpl that = (BooleanSetAttributeImpl) o;
092
093        return new EqualsBuilder().append(name, that.name).append(type, that.type).append(value, that.value).isEquals();
094    }
095
096    @Override
097    public int hashCode() {
098        return new HashCodeBuilder(17, 37).append(name).append(type).append(value).toHashCode();
099    }
100
101}