001 002package com.commercetools.api.models.order_edit; 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 * StagedOrderSetLineItemCustomFieldAction 019 */ 020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 021public class StagedOrderSetLineItemCustomFieldActionImpl implements StagedOrderSetLineItemCustomFieldAction, ModelBase { 022 023 private String action; 024 025 private String lineItemId; 026 027 private String lineItemKey; 028 029 private String name; 030 031 private java.lang.Object value; 032 033 /** 034 * create instance with all properties 035 */ 036 @JsonCreator 037 StagedOrderSetLineItemCustomFieldActionImpl(@JsonProperty("lineItemId") final String lineItemId, 038 @JsonProperty("lineItemKey") final String lineItemKey, @JsonProperty("name") final String name, 039 @JsonProperty("value") final java.lang.Object value) { 040 this.lineItemId = lineItemId; 041 this.lineItemKey = lineItemKey; 042 this.name = name; 043 this.value = value; 044 this.action = SET_LINE_ITEM_CUSTOM_FIELD; 045 } 046 047 /** 048 * create empty instance 049 */ 050 public StagedOrderSetLineItemCustomFieldActionImpl() { 051 this.action = SET_LINE_ITEM_CUSTOM_FIELD; 052 } 053 054 /** 055 * 056 */ 057 058 public String getAction() { 059 return this.action; 060 } 061 062 /** 063 * <p><code>id</code> of the LineItem to update. Either <code>lineItemId</code> or <code>lineItemKey</code> is required.</p> 064 */ 065 066 public String getLineItemId() { 067 return this.lineItemId; 068 } 069 070 /** 071 * <p><code>key</code> of the LineItem to update. Either <code>lineItemId</code> or <code>lineItemKey</code> is required.</p> 072 */ 073 074 public String getLineItemKey() { 075 return this.lineItemKey; 076 } 077 078 /** 079 * <p>Name of the Custom Field.</p> 080 */ 081 082 public String getName() { 083 return this.name; 084 } 085 086 /** 087 * <p>If <code>value</code> is absent or <code>null</code>, this field will be removed if it exists. Removing a field that does not exist returns an InvalidOperation error. If <code>value</code> is provided, it is set for the field defined by <code>name</code>.</p> 088 */ 089 090 public java.lang.Object getValue() { 091 return this.value; 092 } 093 094 public void setLineItemId(final String lineItemId) { 095 this.lineItemId = lineItemId; 096 } 097 098 public void setLineItemKey(final String lineItemKey) { 099 this.lineItemKey = lineItemKey; 100 } 101 102 public void setName(final String name) { 103 this.name = name; 104 } 105 106 public void setValue(final java.lang.Object value) { 107 this.value = value; 108 } 109 110 @Override 111 public boolean equals(Object o) { 112 if (this == o) 113 return true; 114 115 if (o == null || getClass() != o.getClass()) 116 return false; 117 118 StagedOrderSetLineItemCustomFieldActionImpl that = (StagedOrderSetLineItemCustomFieldActionImpl) o; 119 120 return new EqualsBuilder().append(action, that.action) 121 .append(lineItemId, that.lineItemId) 122 .append(lineItemKey, that.lineItemKey) 123 .append(name, that.name) 124 .append(value, that.value) 125 .append(action, that.action) 126 .append(lineItemId, that.lineItemId) 127 .append(lineItemKey, that.lineItemKey) 128 .append(name, that.name) 129 .append(value, that.value) 130 .isEquals(); 131 } 132 133 @Override 134 public int hashCode() { 135 return new HashCodeBuilder(17, 37).append(action) 136 .append(lineItemId) 137 .append(lineItemKey) 138 .append(name) 139 .append(value) 140 .toHashCode(); 141 } 142 143}