001 002package com.commercetools.api.models.message; 003 004import java.util.*; 005import java.util.function.Function; 006 007import javax.annotation.Nullable; 008 009import io.vrap.rmf.base.client.Builder; 010import io.vrap.rmf.base.client.utils.Generated; 011 012/** 013 * PaymentStatusInterfaceCodeSetMessageBuilder 014 * <hr> 015 * Example to create an instance using the builder pattern 016 * <div class=code-example> 017 * <pre><code class='java'> 018 * PaymentStatusInterfaceCodeSetMessage paymentStatusInterfaceCodeSetMessage = PaymentStatusInterfaceCodeSetMessage.builder() 019 * .id("{id}") 020 * .version(0.3) 021 * .createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z")) 022 * .lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z")) 023 * .sequenceNumber(0.3) 024 * .resource(resourceBuilder -> resourceBuilder) 025 * .resourceVersion(0.3) 026 * .paymentId("{paymentId}") 027 * .build() 028 * </code></pre> 029 * </div> 030 */ 031@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 032public class PaymentStatusInterfaceCodeSetMessageBuilder implements Builder<PaymentStatusInterfaceCodeSetMessage> { 033 034 private String id; 035 036 private Long version; 037 038 private java.time.ZonedDateTime createdAt; 039 040 private java.time.ZonedDateTime lastModifiedAt; 041 042 @Nullable 043 private com.commercetools.api.models.common.LastModifiedBy lastModifiedBy; 044 045 @Nullable 046 private com.commercetools.api.models.common.CreatedBy createdBy; 047 048 private Long sequenceNumber; 049 050 private com.commercetools.api.models.common.Reference resource; 051 052 private Long resourceVersion; 053 054 @Nullable 055 private com.commercetools.api.models.message.UserProvidedIdentifiers resourceUserProvidedIdentifiers; 056 057 @Nullable 058 private String interfaceCode; 059 060 /** 061 * <p>Unique identifier of the Message. Can be used to track which Messages have been processed.</p> 062 * @param id value to be set 063 * @return Builder 064 */ 065 066 public PaymentStatusInterfaceCodeSetMessageBuilder id(final String id) { 067 this.id = id; 068 return this; 069 } 070 071 /** 072 * <p>Version of a resource. In case of Messages, this is always <code>1</code>.</p> 073 * @param version value to be set 074 * @return Builder 075 */ 076 077 public PaymentStatusInterfaceCodeSetMessageBuilder version(final Long version) { 078 this.version = version; 079 return this; 080 } 081 082 /** 083 * <p>Date and time (UTC) the Message was generated.</p> 084 * @param createdAt value to be set 085 * @return Builder 086 */ 087 088 public PaymentStatusInterfaceCodeSetMessageBuilder createdAt(final java.time.ZonedDateTime createdAt) { 089 this.createdAt = createdAt; 090 return this; 091 } 092 093 /** 094 * <p>Value of <code>createdAt</code>.</p> 095 * @param lastModifiedAt value to be set 096 * @return Builder 097 */ 098 099 public PaymentStatusInterfaceCodeSetMessageBuilder lastModifiedAt(final java.time.ZonedDateTime lastModifiedAt) { 100 this.lastModifiedAt = lastModifiedAt; 101 return this; 102 } 103 104 /** 105 * <p>Value of <code>createdBy</code>.</p> 106 * @param builder function to build the lastModifiedBy value 107 * @return Builder 108 */ 109 110 public PaymentStatusInterfaceCodeSetMessageBuilder lastModifiedBy( 111 Function<com.commercetools.api.models.common.LastModifiedByBuilder, com.commercetools.api.models.common.LastModifiedByBuilder> builder) { 112 this.lastModifiedBy = builder.apply(com.commercetools.api.models.common.LastModifiedByBuilder.of()).build(); 113 return this; 114 } 115 116 /** 117 * <p>Value of <code>createdBy</code>.</p> 118 * @param builder function to build the lastModifiedBy value 119 * @return Builder 120 */ 121 122 public PaymentStatusInterfaceCodeSetMessageBuilder withLastModifiedBy( 123 Function<com.commercetools.api.models.common.LastModifiedByBuilder, com.commercetools.api.models.common.LastModifiedBy> builder) { 124 this.lastModifiedBy = builder.apply(com.commercetools.api.models.common.LastModifiedByBuilder.of()); 125 return this; 126 } 127 128 /** 129 * <p>Value of <code>createdBy</code>.</p> 130 * @param lastModifiedBy value to be set 131 * @return Builder 132 */ 133 134 public PaymentStatusInterfaceCodeSetMessageBuilder lastModifiedBy( 135 @Nullable final com.commercetools.api.models.common.LastModifiedBy lastModifiedBy) { 136 this.lastModifiedBy = lastModifiedBy; 137 return this; 138 } 139 140 /** 141 * <p>Present on resources created after 1 February 2019 except for events not tracked.</p> 142 * @param builder function to build the createdBy value 143 * @return Builder 144 */ 145 146 public PaymentStatusInterfaceCodeSetMessageBuilder createdBy( 147 Function<com.commercetools.api.models.common.CreatedByBuilder, com.commercetools.api.models.common.CreatedByBuilder> builder) { 148 this.createdBy = builder.apply(com.commercetools.api.models.common.CreatedByBuilder.of()).build(); 149 return this; 150 } 151 152 /** 153 * <p>Present on resources created after 1 February 2019 except for events not tracked.</p> 154 * @param builder function to build the createdBy value 155 * @return Builder 156 */ 157 158 public PaymentStatusInterfaceCodeSetMessageBuilder withCreatedBy( 159 Function<com.commercetools.api.models.common.CreatedByBuilder, com.commercetools.api.models.common.CreatedBy> builder) { 160 this.createdBy = builder.apply(com.commercetools.api.models.common.CreatedByBuilder.of()); 161 return this; 162 } 163 164 /** 165 * <p>Present on resources created after 1 February 2019 except for events not tracked.</p> 166 * @param createdBy value to be set 167 * @return Builder 168 */ 169 170 public PaymentStatusInterfaceCodeSetMessageBuilder createdBy( 171 @Nullable final com.commercetools.api.models.common.CreatedBy createdBy) { 172 this.createdBy = createdBy; 173 return this; 174 } 175 176 /** 177 * <p>Message number in relation to other Messages for a given resource. The <code>sequenceNumber</code> of the next Message for the resource is the successor of the <code>sequenceNumber</code> of the current Message. Meaning, the <code>sequenceNumber</code> of the next Message equals the <code>sequenceNumber</code> of the current Message + 1. <code>sequenceNumber</code> can be used to ensure that Messages are processed in the correct order for a particular resource.</p> 178 * @param sequenceNumber value to be set 179 * @return Builder 180 */ 181 182 public PaymentStatusInterfaceCodeSetMessageBuilder sequenceNumber(final Long sequenceNumber) { 183 this.sequenceNumber = sequenceNumber; 184 return this; 185 } 186 187 /** 188 * <p>Reference to the resource on which the change or action was performed.</p> 189 * @param resource value to be set 190 * @return Builder 191 */ 192 193 public PaymentStatusInterfaceCodeSetMessageBuilder resource( 194 final com.commercetools.api.models.common.Reference resource) { 195 this.resource = resource; 196 return this; 197 } 198 199 /** 200 * <p>Reference to the resource on which the change or action was performed.</p> 201 * @param builder function to build the resource value 202 * @return Builder 203 */ 204 205 public PaymentStatusInterfaceCodeSetMessageBuilder resource( 206 Function<com.commercetools.api.models.common.ReferenceBuilder, Builder<? extends com.commercetools.api.models.common.Reference>> builder) { 207 this.resource = builder.apply(com.commercetools.api.models.common.ReferenceBuilder.of()).build(); 208 return this; 209 } 210 211 /** 212 * <p>Version of the resource on which the change or action was performed.</p> 213 * @param resourceVersion value to be set 214 * @return Builder 215 */ 216 217 public PaymentStatusInterfaceCodeSetMessageBuilder resourceVersion(final Long resourceVersion) { 218 this.resourceVersion = resourceVersion; 219 return this; 220 } 221 222 /** 223 * <p>User-provided identifiers of the resource, such as <code>key</code> or <code>externalId</code>. Only present if the resource has such identifiers.</p> 224 * @param builder function to build the resourceUserProvidedIdentifiers value 225 * @return Builder 226 */ 227 228 public PaymentStatusInterfaceCodeSetMessageBuilder resourceUserProvidedIdentifiers( 229 Function<com.commercetools.api.models.message.UserProvidedIdentifiersBuilder, com.commercetools.api.models.message.UserProvidedIdentifiersBuilder> builder) { 230 this.resourceUserProvidedIdentifiers = builder 231 .apply(com.commercetools.api.models.message.UserProvidedIdentifiersBuilder.of()) 232 .build(); 233 return this; 234 } 235 236 /** 237 * <p>User-provided identifiers of the resource, such as <code>key</code> or <code>externalId</code>. Only present if the resource has such identifiers.</p> 238 * @param builder function to build the resourceUserProvidedIdentifiers value 239 * @return Builder 240 */ 241 242 public PaymentStatusInterfaceCodeSetMessageBuilder withResourceUserProvidedIdentifiers( 243 Function<com.commercetools.api.models.message.UserProvidedIdentifiersBuilder, com.commercetools.api.models.message.UserProvidedIdentifiers> builder) { 244 this.resourceUserProvidedIdentifiers = builder 245 .apply(com.commercetools.api.models.message.UserProvidedIdentifiersBuilder.of()); 246 return this; 247 } 248 249 /** 250 * <p>User-provided identifiers of the resource, such as <code>key</code> or <code>externalId</code>. Only present if the resource has such identifiers.</p> 251 * @param resourceUserProvidedIdentifiers value to be set 252 * @return Builder 253 */ 254 255 public PaymentStatusInterfaceCodeSetMessageBuilder resourceUserProvidedIdentifiers( 256 @Nullable final com.commercetools.api.models.message.UserProvidedIdentifiers resourceUserProvidedIdentifiers) { 257 this.resourceUserProvidedIdentifiers = resourceUserProvidedIdentifiers; 258 return this; 259 } 260 261 /** 262 * <p>The <code>interfaceCode</code> that was set during the Set StatusInterfaceCode update action.</p> 263 * @param interfaceCode value to be set 264 * @return Builder 265 */ 266 267 public PaymentStatusInterfaceCodeSetMessageBuilder interfaceCode(@Nullable final String interfaceCode) { 268 this.interfaceCode = interfaceCode; 269 return this; 270 } 271 272 /** 273 * <p>Unique identifier of the Message. Can be used to track which Messages have been processed.</p> 274 * @return id 275 */ 276 277 public String getId() { 278 return this.id; 279 } 280 281 /** 282 * <p>Version of a resource. In case of Messages, this is always <code>1</code>.</p> 283 * @return version 284 */ 285 286 public Long getVersion() { 287 return this.version; 288 } 289 290 /** 291 * <p>Date and time (UTC) the Message was generated.</p> 292 * @return createdAt 293 */ 294 295 public java.time.ZonedDateTime getCreatedAt() { 296 return this.createdAt; 297 } 298 299 /** 300 * <p>Value of <code>createdAt</code>.</p> 301 * @return lastModifiedAt 302 */ 303 304 public java.time.ZonedDateTime getLastModifiedAt() { 305 return this.lastModifiedAt; 306 } 307 308 /** 309 * <p>Value of <code>createdBy</code>.</p> 310 * @return lastModifiedBy 311 */ 312 313 @Nullable 314 public com.commercetools.api.models.common.LastModifiedBy getLastModifiedBy() { 315 return this.lastModifiedBy; 316 } 317 318 /** 319 * <p>Present on resources created after 1 February 2019 except for events not tracked.</p> 320 * @return createdBy 321 */ 322 323 @Nullable 324 public com.commercetools.api.models.common.CreatedBy getCreatedBy() { 325 return this.createdBy; 326 } 327 328 /** 329 * <p>Message number in relation to other Messages for a given resource. The <code>sequenceNumber</code> of the next Message for the resource is the successor of the <code>sequenceNumber</code> of the current Message. Meaning, the <code>sequenceNumber</code> of the next Message equals the <code>sequenceNumber</code> of the current Message + 1. <code>sequenceNumber</code> can be used to ensure that Messages are processed in the correct order for a particular resource.</p> 330 * @return sequenceNumber 331 */ 332 333 public Long getSequenceNumber() { 334 return this.sequenceNumber; 335 } 336 337 /** 338 * <p>Reference to the resource on which the change or action was performed.</p> 339 * @return resource 340 */ 341 342 public com.commercetools.api.models.common.Reference getResource() { 343 return this.resource; 344 } 345 346 /** 347 * <p>Version of the resource on which the change or action was performed.</p> 348 * @return resourceVersion 349 */ 350 351 public Long getResourceVersion() { 352 return this.resourceVersion; 353 } 354 355 /** 356 * <p>User-provided identifiers of the resource, such as <code>key</code> or <code>externalId</code>. Only present if the resource has such identifiers.</p> 357 * @return resourceUserProvidedIdentifiers 358 */ 359 360 @Nullable 361 public com.commercetools.api.models.message.UserProvidedIdentifiers getResourceUserProvidedIdentifiers() { 362 return this.resourceUserProvidedIdentifiers; 363 } 364 365 /** 366 * <p>The <code>interfaceCode</code> that was set during the Set StatusInterfaceCode update action.</p> 367 * @return interfaceCode 368 */ 369 370 @Nullable 371 public String getInterfaceCode() { 372 return this.interfaceCode; 373 } 374 375 /** 376 * builds PaymentStatusInterfaceCodeSetMessage with checking for non-null required values 377 * @return PaymentStatusInterfaceCodeSetMessage 378 */ 379 public PaymentStatusInterfaceCodeSetMessage build() { 380 Objects.requireNonNull(id, PaymentStatusInterfaceCodeSetMessage.class + ": id is missing"); 381 Objects.requireNonNull(version, PaymentStatusInterfaceCodeSetMessage.class + ": version is missing"); 382 Objects.requireNonNull(createdAt, PaymentStatusInterfaceCodeSetMessage.class + ": createdAt is missing"); 383 Objects.requireNonNull(lastModifiedAt, 384 PaymentStatusInterfaceCodeSetMessage.class + ": lastModifiedAt is missing"); 385 Objects.requireNonNull(sequenceNumber, 386 PaymentStatusInterfaceCodeSetMessage.class + ": sequenceNumber is missing"); 387 Objects.requireNonNull(resource, PaymentStatusInterfaceCodeSetMessage.class + ": resource is missing"); 388 Objects.requireNonNull(resourceVersion, 389 PaymentStatusInterfaceCodeSetMessage.class + ": resourceVersion is missing"); 390 return new PaymentStatusInterfaceCodeSetMessageImpl(id, version, createdAt, lastModifiedAt, lastModifiedBy, 391 createdBy, sequenceNumber, resource, resourceVersion, resourceUserProvidedIdentifiers, interfaceCode); 392 } 393 394 /** 395 * builds PaymentStatusInterfaceCodeSetMessage without checking for non-null required values 396 * @return PaymentStatusInterfaceCodeSetMessage 397 */ 398 public PaymentStatusInterfaceCodeSetMessage buildUnchecked() { 399 return new PaymentStatusInterfaceCodeSetMessageImpl(id, version, createdAt, lastModifiedAt, lastModifiedBy, 400 createdBy, sequenceNumber, resource, resourceVersion, resourceUserProvidedIdentifiers, interfaceCode); 401 } 402 403 /** 404 * factory method for an instance of PaymentStatusInterfaceCodeSetMessageBuilder 405 * @return builder 406 */ 407 public static PaymentStatusInterfaceCodeSetMessageBuilder of() { 408 return new PaymentStatusInterfaceCodeSetMessageBuilder(); 409 } 410 411 /** 412 * create builder for PaymentStatusInterfaceCodeSetMessage instance 413 * @param template instance with prefilled values for the builder 414 * @return builder 415 */ 416 public static PaymentStatusInterfaceCodeSetMessageBuilder of(final PaymentStatusInterfaceCodeSetMessage template) { 417 PaymentStatusInterfaceCodeSetMessageBuilder builder = new PaymentStatusInterfaceCodeSetMessageBuilder(); 418 builder.id = template.getId(); 419 builder.version = template.getVersion(); 420 builder.createdAt = template.getCreatedAt(); 421 builder.lastModifiedAt = template.getLastModifiedAt(); 422 builder.lastModifiedBy = template.getLastModifiedBy(); 423 builder.createdBy = template.getCreatedBy(); 424 builder.sequenceNumber = template.getSequenceNumber(); 425 builder.resource = template.getResource(); 426 builder.resourceVersion = template.getResourceVersion(); 427 builder.resourceUserProvidedIdentifiers = template.getResourceUserProvidedIdentifiers(); 428 builder.interfaceCode = template.getInterfaceCode(); 429 return builder; 430 } 431 432}