001 002package com.commercetools.api.models.customer; 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>Sets the default billing address from <code>addresses</code>. The action adds the <code>id</code> of the specified Address to the <code>billingAddressIds</code> if not contained already. Either <code>addressId</code> or <code>addressKey</code> is required.</p> 019 */ 020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 021public class CustomerSetDefaultBillingAddressActionImpl implements CustomerSetDefaultBillingAddressAction, ModelBase { 022 023 private String action; 024 025 private String addressId; 026 027 private String addressKey; 028 029 /** 030 * create instance with all properties 031 */ 032 @JsonCreator 033 CustomerSetDefaultBillingAddressActionImpl(@JsonProperty("addressId") final String addressId, 034 @JsonProperty("addressKey") final String addressKey) { 035 this.addressId = addressId; 036 this.addressKey = addressKey; 037 this.action = SET_DEFAULT_BILLING_ADDRESS; 038 } 039 040 /** 041 * create empty instance 042 */ 043 public CustomerSetDefaultBillingAddressActionImpl() { 044 this.action = SET_DEFAULT_BILLING_ADDRESS; 045 } 046 047 /** 048 * 049 */ 050 051 public String getAction() { 052 return this.action; 053 } 054 055 /** 056 * <p><code>id</code> of the Address to become the default billing address.</p> 057 */ 058 059 public String getAddressId() { 060 return this.addressId; 061 } 062 063 /** 064 * <p><code>key</code> of the Address to become the default billing address.</p> 065 */ 066 067 public String getAddressKey() { 068 return this.addressKey; 069 } 070 071 public void setAddressId(final String addressId) { 072 this.addressId = addressId; 073 } 074 075 public void setAddressKey(final String addressKey) { 076 this.addressKey = addressKey; 077 } 078 079 @Override 080 public boolean equals(Object o) { 081 if (this == o) 082 return true; 083 084 if (o == null || getClass() != o.getClass()) 085 return false; 086 087 CustomerSetDefaultBillingAddressActionImpl that = (CustomerSetDefaultBillingAddressActionImpl) o; 088 089 return new EqualsBuilder().append(action, that.action) 090 .append(addressId, that.addressId) 091 .append(addressKey, that.addressKey) 092 .append(action, that.action) 093 .append(addressId, that.addressId) 094 .append(addressKey, that.addressKey) 095 .isEquals(); 096 } 097 098 @Override 099 public int hashCode() { 100 return new HashCodeBuilder(17, 37).append(action).append(addressId).append(addressKey).toHashCode(); 101 } 102 103}