io.sphere.sdk.extensions.ExtensionDraftDsl Maven / Gradle / Ivy
package io.sphere.sdk.extensions;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.sphere.sdk.models.Base;
import java.lang.Long;
import java.lang.String;
import java.util.List;
import javax.annotation.Generated;
import javax.annotation.Nullable;
/**
* Dsl class for {@link ExtensionDraft}.
*/
@Generated(
value = "io.sphere.sdk.annotations.processors.generators.ResourceDraftValueGenerator",
comments = "Generated from: io.sphere.sdk.extensions.ExtensionDraft"
)
public final class ExtensionDraftDsl extends Base implements ExtensionDraft {
private Destination destination;
@Nullable
private String key;
@Nullable
private Long timeoutInMs;
private List triggers;
@JsonCreator
ExtensionDraftDsl(final Destination destination, @Nullable final String key,
@Nullable final Long timeoutInMs, final List triggers) {
this.destination = destination;
this.key = key;
this.timeoutInMs = timeoutInMs;
this.triggers = triggers;
}
public Destination getDestination() {
return destination;
}
@Nullable
public String getKey() {
return key;
}
@Nullable
public Long getTimeoutInMs() {
return timeoutInMs;
}
public List getTriggers() {
return triggers;
}
/**
* Creates a new builder with the values of this object.
*
* @return new builder
*/
public ExtensionDraftBuilder newBuilder() {
return new ExtensionDraftBuilder(destination, key, timeoutInMs, triggers);
}
public ExtensionDraftDsl withDestination(final Destination destination) {
return newBuilder().destination(destination).build();
}
public ExtensionDraftDsl withKey(@Nullable final String key) {
return newBuilder().key(key).build();
}
public ExtensionDraftDsl withTimeoutInMs(@Nullable final Long timeoutInMs) {
return newBuilder().timeoutInMs(timeoutInMs).build();
}
public ExtensionDraftDsl withTriggers(final List triggers) {
return newBuilder().triggers(triggers).build();
}
/**
* Creates a new object initialized with the given values.
*
* @param key initial value for the {@link ExtensionDraft#getKey()} property
* @param destination initial value for the {@link ExtensionDraft#getDestination()} property
* @param triggers initial value for the {@link ExtensionDraft#getTriggers()} property
* @param timeoutInMs initial value for the {@link ExtensionDraft#getTimeoutInMs()} property
* @return new object initialized with the given values
*/
public static ExtensionDraftDsl of(@Nullable final String key, final Destination destination,
final List triggers, @Nullable final Long timeoutInMs) {
return new ExtensionDraftDsl(destination, key, timeoutInMs, triggers);
}
/**
* Creates a new object initialized with the given values.
*
* @param key initial value for the {@link ExtensionDraft#getKey()} property
* @param destination initial value for the {@link ExtensionDraft#getDestination()} property
* @param triggers initial value for the {@link ExtensionDraft#getTriggers()} property
* @return new object initialized with the given values
*/
public static ExtensionDraftDsl of(@Nullable final String key, final Destination destination,
final List triggers) {
return new ExtensionDraftDsl(destination, key, null, triggers);
}
/**
* Creates a new object initialized with the given values.
*
* @param destination initial value for the {@link ExtensionDraft#getDestination()} property
* @param triggers initial value for the {@link ExtensionDraft#getTriggers()} property
* @return new object initialized with the given values
*/
public static ExtensionDraftDsl of(final Destination destination, final List triggers) {
return new ExtensionDraftDsl(destination, null, null, triggers);
}
/**
* 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 ExtensionDraftDsl of(final ExtensionDraft template) {
return new ExtensionDraftDsl(template.getDestination(), template.getKey(), template.getTimeoutInMs(), template.getTriggers());
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy