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

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

The newest version!
package io.sphere.sdk.subscriptions;

import com.fasterxml.jackson.annotation.JsonCreator;
import io.sphere.sdk.models.Base;
import java.lang.String;
import java.util.List;
import javax.annotation.Generated;
import javax.annotation.Nullable;

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

  private Destination destination;

  @Nullable
  private String key;

  @Nullable
  private List messages;

  @JsonCreator
  SubscriptionDraftDsl(@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;
  }

  @Nullable
  public List getChanges() {
    return changes;
  }

  public Destination getDestination() {
    return destination;
  }

  @Nullable
  public String getKey() {
    return key;
  }

  @Nullable
  public List getMessages() {
    return messages;
  }

  /**
   * Creates a new builder with the values of this object.
   *
   * @return new builder
   */
  public SubscriptionDraftBuilder newBuilder() {
    return new SubscriptionDraftBuilder(changes, destination, key, messages);
  }

  public SubscriptionDraftDsl withChanges(@Nullable final List changes) {
    return newBuilder().changes(changes).build();
  }

  public SubscriptionDraftDsl withDestination(final Destination destination) {
    return newBuilder().destination(destination).build();
  }

  public SubscriptionDraftDsl withKey(@Nullable final String key) {
    return newBuilder().key(key).build();
  }

  public SubscriptionDraftDsl withMessages(@Nullable final List messages) {
    return newBuilder().messages(messages).build();
  }

  /**
   * 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 SubscriptionDraftDsl of(final Destination destination) {
    return new SubscriptionDraftDsl(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 SubscriptionDraftDsl of(final SubscriptionDraft template) {
    return new SubscriptionDraftDsl(template.getChanges(), template.getDestination(), template.getKey(), template.getMessages());
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy