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 * StandalonePriceStagedChangesAppliedMessageBuilder 014 * <hr> 015 * Example to create an instance using the builder pattern 016 * <div class=code-example> 017 * <pre><code class='java'> 018 * StandalonePriceStagedChangesAppliedMessage standalonePriceStagedChangesAppliedMessage = StandalonePriceStagedChangesAppliedMessage.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 * .stagedChanges(stagedChangesBuilder -> stagedChangesBuilder) 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 StandalonePriceStagedChangesAppliedMessageBuilder 033 implements Builder<StandalonePriceStagedChangesAppliedMessage> { 034 035 private String id; 036 037 private Long version; 038 039 private java.time.ZonedDateTime createdAt; 040 041 private java.time.ZonedDateTime lastModifiedAt; 042 043 @Nullable 044 private com.commercetools.api.models.common.LastModifiedBy lastModifiedBy; 045 046 @Nullable 047 private com.commercetools.api.models.common.CreatedBy createdBy; 048 049 private Long sequenceNumber; 050 051 private com.commercetools.api.models.common.Reference resource; 052 053 private Long resourceVersion; 054 055 @Nullable 056 private com.commercetools.api.models.message.UserProvidedIdentifiers resourceUserProvidedIdentifiers; 057 058 private com.commercetools.api.models.standalone_price.StagedStandalonePrice stagedChanges; 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 StandalonePriceStagedChangesAppliedMessageBuilder 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 StandalonePriceStagedChangesAppliedMessageBuilder 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 StandalonePriceStagedChangesAppliedMessageBuilder 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 StandalonePriceStagedChangesAppliedMessageBuilder lastModifiedAt( 100 final java.time.ZonedDateTime lastModifiedAt) { 101 this.lastModifiedAt = lastModifiedAt; 102 return this; 103 } 104 105 /** 106 * <p>Value of <code>createdBy</code>.</p> 107 * @param builder function to build the lastModifiedBy value 108 * @return Builder 109 */ 110 111 public StandalonePriceStagedChangesAppliedMessageBuilder lastModifiedBy( 112 Function<com.commercetools.api.models.common.LastModifiedByBuilder, com.commercetools.api.models.common.LastModifiedByBuilder> builder) { 113 this.lastModifiedBy = builder.apply(com.commercetools.api.models.common.LastModifiedByBuilder.of()).build(); 114 return this; 115 } 116 117 /** 118 * <p>Value of <code>createdBy</code>.</p> 119 * @param builder function to build the lastModifiedBy value 120 * @return Builder 121 */ 122 123 public StandalonePriceStagedChangesAppliedMessageBuilder withLastModifiedBy( 124 Function<com.commercetools.api.models.common.LastModifiedByBuilder, com.commercetools.api.models.common.LastModifiedBy> builder) { 125 this.lastModifiedBy = builder.apply(com.commercetools.api.models.common.LastModifiedByBuilder.of()); 126 return this; 127 } 128 129 /** 130 * <p>Value of <code>createdBy</code>.</p> 131 * @param lastModifiedBy value to be set 132 * @return Builder 133 */ 134 135 public StandalonePriceStagedChangesAppliedMessageBuilder lastModifiedBy( 136 @Nullable final com.commercetools.api.models.common.LastModifiedBy lastModifiedBy) { 137 this.lastModifiedBy = lastModifiedBy; 138 return this; 139 } 140 141 /** 142 * <p>Present on resources created after 1 February 2019 except for events not tracked.</p> 143 * @param builder function to build the createdBy value 144 * @return Builder 145 */ 146 147 public StandalonePriceStagedChangesAppliedMessageBuilder createdBy( 148 Function<com.commercetools.api.models.common.CreatedByBuilder, com.commercetools.api.models.common.CreatedByBuilder> builder) { 149 this.createdBy = builder.apply(com.commercetools.api.models.common.CreatedByBuilder.of()).build(); 150 return this; 151 } 152 153 /** 154 * <p>Present on resources created after 1 February 2019 except for events not tracked.</p> 155 * @param builder function to build the createdBy value 156 * @return Builder 157 */ 158 159 public StandalonePriceStagedChangesAppliedMessageBuilder withCreatedBy( 160 Function<com.commercetools.api.models.common.CreatedByBuilder, com.commercetools.api.models.common.CreatedBy> builder) { 161 this.createdBy = builder.apply(com.commercetools.api.models.common.CreatedByBuilder.of()); 162 return this; 163 } 164 165 /** 166 * <p>Present on resources created after 1 February 2019 except for events not tracked.</p> 167 * @param createdBy value to be set 168 * @return Builder 169 */ 170 171 public StandalonePriceStagedChangesAppliedMessageBuilder createdBy( 172 @Nullable final com.commercetools.api.models.common.CreatedBy createdBy) { 173 this.createdBy = createdBy; 174 return this; 175 } 176 177 /** 178 * <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> 179 * @param sequenceNumber value to be set 180 * @return Builder 181 */ 182 183 public StandalonePriceStagedChangesAppliedMessageBuilder sequenceNumber(final Long sequenceNumber) { 184 this.sequenceNumber = sequenceNumber; 185 return this; 186 } 187 188 /** 189 * <p>Reference to the resource on which the change or action was performed.</p> 190 * @param resource value to be set 191 * @return Builder 192 */ 193 194 public StandalonePriceStagedChangesAppliedMessageBuilder resource( 195 final com.commercetools.api.models.common.Reference resource) { 196 this.resource = resource; 197 return this; 198 } 199 200 /** 201 * <p>Reference to the resource on which the change or action was performed.</p> 202 * @param builder function to build the resource value 203 * @return Builder 204 */ 205 206 public StandalonePriceStagedChangesAppliedMessageBuilder resource( 207 Function<com.commercetools.api.models.common.ReferenceBuilder, Builder<? extends com.commercetools.api.models.common.Reference>> builder) { 208 this.resource = builder.apply(com.commercetools.api.models.common.ReferenceBuilder.of()).build(); 209 return this; 210 } 211 212 /** 213 * <p>Version of the resource on which the change or action was performed.</p> 214 * @param resourceVersion value to be set 215 * @return Builder 216 */ 217 218 public StandalonePriceStagedChangesAppliedMessageBuilder resourceVersion(final Long resourceVersion) { 219 this.resourceVersion = resourceVersion; 220 return this; 221 } 222 223 /** 224 * <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> 225 * @param builder function to build the resourceUserProvidedIdentifiers value 226 * @return Builder 227 */ 228 229 public StandalonePriceStagedChangesAppliedMessageBuilder resourceUserProvidedIdentifiers( 230 Function<com.commercetools.api.models.message.UserProvidedIdentifiersBuilder, com.commercetools.api.models.message.UserProvidedIdentifiersBuilder> builder) { 231 this.resourceUserProvidedIdentifiers = builder 232 .apply(com.commercetools.api.models.message.UserProvidedIdentifiersBuilder.of()) 233 .build(); 234 return this; 235 } 236 237 /** 238 * <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> 239 * @param builder function to build the resourceUserProvidedIdentifiers value 240 * @return Builder 241 */ 242 243 public StandalonePriceStagedChangesAppliedMessageBuilder withResourceUserProvidedIdentifiers( 244 Function<com.commercetools.api.models.message.UserProvidedIdentifiersBuilder, com.commercetools.api.models.message.UserProvidedIdentifiers> builder) { 245 this.resourceUserProvidedIdentifiers = builder 246 .apply(com.commercetools.api.models.message.UserProvidedIdentifiersBuilder.of()); 247 return this; 248 } 249 250 /** 251 * <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> 252 * @param resourceUserProvidedIdentifiers value to be set 253 * @return Builder 254 */ 255 256 public StandalonePriceStagedChangesAppliedMessageBuilder resourceUserProvidedIdentifiers( 257 @Nullable final com.commercetools.api.models.message.UserProvidedIdentifiers resourceUserProvidedIdentifiers) { 258 this.resourceUserProvidedIdentifiers = resourceUserProvidedIdentifiers; 259 return this; 260 } 261 262 /** 263 * <p>Applied changes of the StandalonePrice after the Apply Staged Changes update action.</p> 264 * @param builder function to build the stagedChanges value 265 * @return Builder 266 */ 267 268 public StandalonePriceStagedChangesAppliedMessageBuilder stagedChanges( 269 Function<com.commercetools.api.models.standalone_price.StagedStandalonePriceBuilder, com.commercetools.api.models.standalone_price.StagedStandalonePriceBuilder> builder) { 270 this.stagedChanges = builder 271 .apply(com.commercetools.api.models.standalone_price.StagedStandalonePriceBuilder.of()) 272 .build(); 273 return this; 274 } 275 276 /** 277 * <p>Applied changes of the StandalonePrice after the Apply Staged Changes update action.</p> 278 * @param builder function to build the stagedChanges value 279 * @return Builder 280 */ 281 282 public StandalonePriceStagedChangesAppliedMessageBuilder withStagedChanges( 283 Function<com.commercetools.api.models.standalone_price.StagedStandalonePriceBuilder, com.commercetools.api.models.standalone_price.StagedStandalonePrice> builder) { 284 this.stagedChanges = builder 285 .apply(com.commercetools.api.models.standalone_price.StagedStandalonePriceBuilder.of()); 286 return this; 287 } 288 289 /** 290 * <p>Applied changes of the StandalonePrice after the Apply Staged Changes update action.</p> 291 * @param stagedChanges value to be set 292 * @return Builder 293 */ 294 295 public StandalonePriceStagedChangesAppliedMessageBuilder stagedChanges( 296 final com.commercetools.api.models.standalone_price.StagedStandalonePrice stagedChanges) { 297 this.stagedChanges = stagedChanges; 298 return this; 299 } 300 301 /** 302 * <p>Unique identifier of the Message. Can be used to track which Messages have been processed.</p> 303 * @return id 304 */ 305 306 public String getId() { 307 return this.id; 308 } 309 310 /** 311 * <p>Version of a resource. In case of Messages, this is always <code>1</code>.</p> 312 * @return version 313 */ 314 315 public Long getVersion() { 316 return this.version; 317 } 318 319 /** 320 * <p>Date and time (UTC) the Message was generated.</p> 321 * @return createdAt 322 */ 323 324 public java.time.ZonedDateTime getCreatedAt() { 325 return this.createdAt; 326 } 327 328 /** 329 * <p>Value of <code>createdAt</code>.</p> 330 * @return lastModifiedAt 331 */ 332 333 public java.time.ZonedDateTime getLastModifiedAt() { 334 return this.lastModifiedAt; 335 } 336 337 /** 338 * <p>Value of <code>createdBy</code>.</p> 339 * @return lastModifiedBy 340 */ 341 342 @Nullable 343 public com.commercetools.api.models.common.LastModifiedBy getLastModifiedBy() { 344 return this.lastModifiedBy; 345 } 346 347 /** 348 * <p>Present on resources created after 1 February 2019 except for events not tracked.</p> 349 * @return createdBy 350 */ 351 352 @Nullable 353 public com.commercetools.api.models.common.CreatedBy getCreatedBy() { 354 return this.createdBy; 355 } 356 357 /** 358 * <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> 359 * @return sequenceNumber 360 */ 361 362 public Long getSequenceNumber() { 363 return this.sequenceNumber; 364 } 365 366 /** 367 * <p>Reference to the resource on which the change or action was performed.</p> 368 * @return resource 369 */ 370 371 public com.commercetools.api.models.common.Reference getResource() { 372 return this.resource; 373 } 374 375 /** 376 * <p>Version of the resource on which the change or action was performed.</p> 377 * @return resourceVersion 378 */ 379 380 public Long getResourceVersion() { 381 return this.resourceVersion; 382 } 383 384 /** 385 * <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> 386 * @return resourceUserProvidedIdentifiers 387 */ 388 389 @Nullable 390 public com.commercetools.api.models.message.UserProvidedIdentifiers getResourceUserProvidedIdentifiers() { 391 return this.resourceUserProvidedIdentifiers; 392 } 393 394 /** 395 * <p>Applied changes of the StandalonePrice after the Apply Staged Changes update action.</p> 396 * @return stagedChanges 397 */ 398 399 public com.commercetools.api.models.standalone_price.StagedStandalonePrice getStagedChanges() { 400 return this.stagedChanges; 401 } 402 403 /** 404 * builds StandalonePriceStagedChangesAppliedMessage with checking for non-null required values 405 * @return StandalonePriceStagedChangesAppliedMessage 406 */ 407 public StandalonePriceStagedChangesAppliedMessage build() { 408 Objects.requireNonNull(id, StandalonePriceStagedChangesAppliedMessage.class + ": id is missing"); 409 Objects.requireNonNull(version, StandalonePriceStagedChangesAppliedMessage.class + ": version is missing"); 410 Objects.requireNonNull(createdAt, StandalonePriceStagedChangesAppliedMessage.class + ": createdAt is missing"); 411 Objects.requireNonNull(lastModifiedAt, 412 StandalonePriceStagedChangesAppliedMessage.class + ": lastModifiedAt is missing"); 413 Objects.requireNonNull(sequenceNumber, 414 StandalonePriceStagedChangesAppliedMessage.class + ": sequenceNumber is missing"); 415 Objects.requireNonNull(resource, StandalonePriceStagedChangesAppliedMessage.class + ": resource is missing"); 416 Objects.requireNonNull(resourceVersion, 417 StandalonePriceStagedChangesAppliedMessage.class + ": resourceVersion is missing"); 418 Objects.requireNonNull(stagedChanges, 419 StandalonePriceStagedChangesAppliedMessage.class + ": stagedChanges is missing"); 420 return new StandalonePriceStagedChangesAppliedMessageImpl(id, version, createdAt, lastModifiedAt, 421 lastModifiedBy, createdBy, sequenceNumber, resource, resourceVersion, resourceUserProvidedIdentifiers, 422 stagedChanges); 423 } 424 425 /** 426 * builds StandalonePriceStagedChangesAppliedMessage without checking for non-null required values 427 * @return StandalonePriceStagedChangesAppliedMessage 428 */ 429 public StandalonePriceStagedChangesAppliedMessage buildUnchecked() { 430 return new StandalonePriceStagedChangesAppliedMessageImpl(id, version, createdAt, lastModifiedAt, 431 lastModifiedBy, createdBy, sequenceNumber, resource, resourceVersion, resourceUserProvidedIdentifiers, 432 stagedChanges); 433 } 434 435 /** 436 * factory method for an instance of StandalonePriceStagedChangesAppliedMessageBuilder 437 * @return builder 438 */ 439 public static StandalonePriceStagedChangesAppliedMessageBuilder of() { 440 return new StandalonePriceStagedChangesAppliedMessageBuilder(); 441 } 442 443 /** 444 * create builder for StandalonePriceStagedChangesAppliedMessage instance 445 * @param template instance with prefilled values for the builder 446 * @return builder 447 */ 448 public static StandalonePriceStagedChangesAppliedMessageBuilder of( 449 final StandalonePriceStagedChangesAppliedMessage template) { 450 StandalonePriceStagedChangesAppliedMessageBuilder builder = new StandalonePriceStagedChangesAppliedMessageBuilder(); 451 builder.id = template.getId(); 452 builder.version = template.getVersion(); 453 builder.createdAt = template.getCreatedAt(); 454 builder.lastModifiedAt = template.getLastModifiedAt(); 455 builder.lastModifiedBy = template.getLastModifiedBy(); 456 builder.createdBy = template.getCreatedBy(); 457 builder.sequenceNumber = template.getSequenceNumber(); 458 builder.resource = template.getResource(); 459 builder.resourceVersion = template.getResourceVersion(); 460 builder.resourceUserProvidedIdentifiers = template.getResourceUserProvidedIdentifiers(); 461 builder.stagedChanges = template.getStagedChanges(); 462 return builder; 463 } 464 465}