001 002package com.commercetools.api.models.shopping_list; 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 * ShoppingListSetCustomTypeAction 019 */ 020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 021public class ShoppingListSetCustomTypeActionImpl implements ShoppingListSetCustomTypeAction, ModelBase { 022 023 private String action; 024 025 private com.commercetools.api.models.type.TypeResourceIdentifier type; 026 027 private com.commercetools.api.models.type.FieldContainer fields; 028 029 /** 030 * create instance with all properties 031 */ 032 @JsonCreator 033 ShoppingListSetCustomTypeActionImpl( 034 @JsonProperty("type") final com.commercetools.api.models.type.TypeResourceIdentifier type, 035 @JsonProperty("fields") final com.commercetools.api.models.type.FieldContainer fields) { 036 this.type = type; 037 this.fields = fields; 038 this.action = SET_CUSTOM_TYPE; 039 } 040 041 /** 042 * create empty instance 043 */ 044 public ShoppingListSetCustomTypeActionImpl() { 045 this.action = SET_CUSTOM_TYPE; 046 } 047 048 /** 049 * 050 */ 051 052 public String getAction() { 053 return this.action; 054 } 055 056 /** 057 * <p>Defines the Type that extends the ShoppingList with Custom Fields. If absent, any existing Type and Custom Fields are removed from the ShoppingList.</p> 058 */ 059 060 public com.commercetools.api.models.type.TypeResourceIdentifier getType() { 061 return this.type; 062 } 063 064 /** 065 * <p>Sets the Custom Fields fields for the ShoppingList.</p> 066 */ 067 068 public com.commercetools.api.models.type.FieldContainer getFields() { 069 return this.fields; 070 } 071 072 public void setType(final com.commercetools.api.models.type.TypeResourceIdentifier type) { 073 this.type = type; 074 } 075 076 public void setFields(final com.commercetools.api.models.type.FieldContainer fields) { 077 this.fields = fields; 078 } 079 080 @Override 081 public boolean equals(Object o) { 082 if (this == o) 083 return true; 084 085 if (o == null || getClass() != o.getClass()) 086 return false; 087 088 ShoppingListSetCustomTypeActionImpl that = (ShoppingListSetCustomTypeActionImpl) o; 089 090 return new EqualsBuilder().append(action, that.action) 091 .append(type, that.type) 092 .append(fields, that.fields) 093 .append(action, that.action) 094 .append(type, that.type) 095 .append(fields, that.fields) 096 .isEquals(); 097 } 098 099 @Override 100 public int hashCode() { 101 return new HashCodeBuilder(17, 37).append(action).append(type).append(fields).toHashCode(); 102 } 103 104}