001 002package com.commercetools.api.models.subscription; 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 * SubscriptionSetChangesAction 019 */ 020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 021public class SubscriptionSetChangesActionImpl implements SubscriptionSetChangesAction, ModelBase { 022 023 private String action; 024 025 private java.util.List<com.commercetools.api.models.subscription.ChangeSubscription> changes; 026 027 /** 028 * create instance with all properties 029 */ 030 @JsonCreator 031 SubscriptionSetChangesActionImpl( 032 @JsonProperty("changes") final java.util.List<com.commercetools.api.models.subscription.ChangeSubscription> changes) { 033 this.changes = changes; 034 this.action = SET_CHANGES; 035 } 036 037 /** 038 * create empty instance 039 */ 040 public SubscriptionSetChangesActionImpl() { 041 this.action = SET_CHANGES; 042 } 043 044 /** 045 * 046 */ 047 048 public String getAction() { 049 return this.action; 050 } 051 052 /** 053 * <p>Value to set. Can only be unset if <code>messages</code> is set.</p> 054 */ 055 056 public java.util.List<com.commercetools.api.models.subscription.ChangeSubscription> getChanges() { 057 return this.changes; 058 } 059 060 public void setChanges(final com.commercetools.api.models.subscription.ChangeSubscription... changes) { 061 this.changes = new ArrayList<>(Arrays.asList(changes)); 062 } 063 064 public void setChanges(final java.util.List<com.commercetools.api.models.subscription.ChangeSubscription> changes) { 065 this.changes = changes; 066 } 067 068 @Override 069 public boolean equals(Object o) { 070 if (this == o) 071 return true; 072 073 if (o == null || getClass() != o.getClass()) 074 return false; 075 076 SubscriptionSetChangesActionImpl that = (SubscriptionSetChangesActionImpl) o; 077 078 return new EqualsBuilder().append(action, that.action).append(changes, that.changes).isEquals(); 079 } 080 081 @Override 082 public int hashCode() { 083 return new HashCodeBuilder(17, 37).append(action).append(changes).toHashCode(); 084 } 085 086}