001
002package com.commercetools.api.models.business_unit;
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 * AssociateRoleAssignment
019 */
020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
021public class AssociateRoleAssignmentImpl implements AssociateRoleAssignment, ModelBase {
022
023    private com.commercetools.api.models.associate_role.AssociateRoleKeyReference associateRole;
024
025    private com.commercetools.api.models.business_unit.AssociateRoleInheritanceMode inheritance;
026
027    /**
028     * create instance with all properties
029     */
030    @JsonCreator
031    AssociateRoleAssignmentImpl(
032            @JsonProperty("associateRole") final com.commercetools.api.models.associate_role.AssociateRoleKeyReference associateRole,
033            @JsonProperty("inheritance") final com.commercetools.api.models.business_unit.AssociateRoleInheritanceMode inheritance) {
034        this.associateRole = associateRole;
035        this.inheritance = inheritance;
036    }
037
038    /**
039     * create empty instance
040     */
041    public AssociateRoleAssignmentImpl() {
042    }
043
044    /**
045     *  <p>Role the Associate holds within a Business Unit.</p>
046     */
047
048    public com.commercetools.api.models.associate_role.AssociateRoleKeyReference getAssociateRole() {
049        return this.associateRole;
050    }
051
052    /**
053     *  <p>Determines whether the AssociateRoleAssignment can be inherited by child Business Units.</p>
054     */
055
056    public com.commercetools.api.models.business_unit.AssociateRoleInheritanceMode getInheritance() {
057        return this.inheritance;
058    }
059
060    public void setAssociateRole(
061            final com.commercetools.api.models.associate_role.AssociateRoleKeyReference associateRole) {
062        this.associateRole = associateRole;
063    }
064
065    public void setInheritance(
066            final com.commercetools.api.models.business_unit.AssociateRoleInheritanceMode inheritance) {
067        this.inheritance = inheritance;
068    }
069
070    @Override
071    public boolean equals(Object o) {
072        if (this == o)
073            return true;
074
075        if (o == null || getClass() != o.getClass())
076            return false;
077
078        AssociateRoleAssignmentImpl that = (AssociateRoleAssignmentImpl) o;
079
080        return new EqualsBuilder().append(associateRole, that.associateRole)
081                .append(inheritance, that.inheritance)
082                .append(associateRole, that.associateRole)
083                .append(inheritance, that.inheritance)
084                .isEquals();
085    }
086
087    @Override
088    public int hashCode() {
089        return new HashCodeBuilder(17, 37).append(associateRole).append(inheritance).toHashCode();
090    }
091
092}