All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.sphere.sdk.subscriptions.SubscriptionDraftBuilder Maven / Gradle / Ivy

There is a newer version: 2.16.0
Show newest version
package io.sphere.sdk.subscriptions;

import io.sphere.sdk.models.Base;
import io.sphere.sdk.models.Builder;
import java.lang.String;
import java.util.List;
import javax.annotation.Generated;
import javax.annotation.Nullable;

/**
 * Builder for {@link SubscriptionDraft}.
 */
@Generated(
    value = "io.sphere.sdk.annotations.processors.generators.DraftBuilderGenerator",
    comments = "Generated from: io.sphere.sdk.subscriptions.SubscriptionDraft"
)
public final class SubscriptionDraftBuilder extends Base implements Builder {
  @Nullable
  private List changes;

  private Destination destination;

  @Nullable
  private String key;

  @Nullable
  private List messages;

  SubscriptionDraftBuilder() {
  }

  SubscriptionDraftBuilder(@Nullable final List changes,
      final Destination destination, @Nullable final String key,
      @Nullable final List messages) {
    this.changes = changes;
    this.destination = destination;
    this.key = key;
    this.messages = messages;
  }

  /**
   * Sets the {@code changes} property of this builder.
   *
   * @param changes the value for {@link SubscriptionDraft#getChanges()}
   * @return this builder
   */
  public SubscriptionDraftBuilder changes(@Nullable final List changes) {
    this.changes = changes;
    return this;
  }

  /**
   * Sets the {@code destination} property of this builder.
   *
   * @param destination the value for {@link SubscriptionDraft#getDestination()}
   * @return this builder
   */
  public SubscriptionDraftBuilder destination(final Destination destination) {
    this.destination = destination;
    return this;
  }

  /**
   * Sets the {@code key} property of this builder.
   *
   * @param key the value for {@link SubscriptionDraft#getKey()}
   * @return this builder
   */
  public SubscriptionDraftBuilder key(@Nullable final String key) {
    this.key = key;
    return this;
  }

  /**
   * Sets the {@code messages} property of this builder.
   *
   * @param messages the value for {@link SubscriptionDraft#getMessages()}
   * @return this builder
   */
  public SubscriptionDraftBuilder messages(@Nullable final List messages) {
    this.messages = messages;
    return this;
  }

  /**
   * Creates a new instance of {@code SubscriptionDraftDsl} with the values of this builder.
   *
   * @return the instance
   */
  public SubscriptionDraftDsl build() {
    return new SubscriptionDraftDsl(changes, destination, key, messages);
  }

  /**
   * Creates a new object initialized with the given values.
   *
   * @param destination initial value for the {@link SubscriptionDraft#getDestination()} property
   * @return new object initialized with the given values
   */
  public static SubscriptionDraftBuilder of(final Destination destination) {
    return new SubscriptionDraftBuilder(null, destination, null, null);
  }

  /**
   * Creates a new object initialized with the fields of the template parameter.
   *
   * @param template the template
   * @return a new object initialized from the template
   */
  public static SubscriptionDraftBuilder of(final SubscriptionDraft template) {
    return new SubscriptionDraftBuilder(template.getChanges(), template.getDestination(), template.getKey(), template.getMessages());
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy