001 002package com.commercetools.api.models.common; 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 * AssetDraft 019 */ 020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 021public class AssetDraftImpl implements AssetDraft, ModelBase { 022 023 private java.util.List<com.commercetools.api.models.common.AssetSource> sources; 024 025 private com.commercetools.api.models.common.LocalizedString name; 026 027 private com.commercetools.api.models.common.LocalizedString description; 028 029 private java.util.List<String> tags; 030 031 private com.commercetools.api.models.type.CustomFieldsDraft custom; 032 033 private String key; 034 035 /** 036 * create instance with all properties 037 */ 038 @JsonCreator 039 AssetDraftImpl( 040 @JsonProperty("sources") final java.util.List<com.commercetools.api.models.common.AssetSource> sources, 041 @JsonProperty("name") final com.commercetools.api.models.common.LocalizedString name, 042 @JsonProperty("description") final com.commercetools.api.models.common.LocalizedString description, 043 @JsonProperty("tags") final java.util.List<String> tags, 044 @JsonProperty("custom") final com.commercetools.api.models.type.CustomFieldsDraft custom, 045 @JsonProperty("key") final String key) { 046 this.sources = sources; 047 this.name = name; 048 this.description = description; 049 this.tags = tags; 050 this.custom = custom; 051 this.key = key; 052 } 053 054 /** 055 * create empty instance 056 */ 057 public AssetDraftImpl() { 058 } 059 060 /** 061 * 062 */ 063 064 public java.util.List<com.commercetools.api.models.common.AssetSource> getSources() { 065 return this.sources; 066 } 067 068 /** 069 * <p>Name of the Asset.</p> 070 */ 071 072 public com.commercetools.api.models.common.LocalizedString getName() { 073 return this.name; 074 } 075 076 /** 077 * <p>Description of the Asset.</p> 078 */ 079 080 public com.commercetools.api.models.common.LocalizedString getDescription() { 081 return this.description; 082 } 083 084 /** 085 * <p>Keywords for categorizing and organizing Assets.</p> 086 */ 087 088 public java.util.List<String> getTags() { 089 return this.tags; 090 } 091 092 /** 093 * <p>Custom Fields defined for the Asset.</p> 094 */ 095 096 public com.commercetools.api.models.type.CustomFieldsDraft getCustom() { 097 return this.custom; 098 } 099 100 /** 101 * <p>User-defined unique identifier for the Asset.</p> 102 */ 103 104 public String getKey() { 105 return this.key; 106 } 107 108 public void setSources(final com.commercetools.api.models.common.AssetSource... sources) { 109 this.sources = new ArrayList<>(Arrays.asList(sources)); 110 } 111 112 public void setSources(final java.util.List<com.commercetools.api.models.common.AssetSource> sources) { 113 this.sources = sources; 114 } 115 116 public void setName(final com.commercetools.api.models.common.LocalizedString name) { 117 this.name = name; 118 } 119 120 public void setDescription(final com.commercetools.api.models.common.LocalizedString description) { 121 this.description = description; 122 } 123 124 public void setTags(final String... tags) { 125 this.tags = new ArrayList<>(Arrays.asList(tags)); 126 } 127 128 public void setTags(final java.util.List<String> tags) { 129 this.tags = tags; 130 } 131 132 public void setCustom(final com.commercetools.api.models.type.CustomFieldsDraft custom) { 133 this.custom = custom; 134 } 135 136 public void setKey(final String key) { 137 this.key = key; 138 } 139 140 @Override 141 public boolean equals(Object o) { 142 if (this == o) 143 return true; 144 145 if (o == null || getClass() != o.getClass()) 146 return false; 147 148 AssetDraftImpl that = (AssetDraftImpl) o; 149 150 return new EqualsBuilder().append(sources, that.sources) 151 .append(name, that.name) 152 .append(description, that.description) 153 .append(tags, that.tags) 154 .append(custom, that.custom) 155 .append(key, that.key) 156 .isEquals(); 157 } 158 159 @Override 160 public int hashCode() { 161 return new HashCodeBuilder(17, 37).append(sources) 162 .append(name) 163 .append(description) 164 .append(tags) 165 .append(custom) 166 .append(key) 167 .toHashCode(); 168 } 169 170}