io.sphere.sdk.extensions.TriggerBuilder Maven / Gradle / Ivy
package io.sphere.sdk.extensions;
import io.sphere.sdk.models.Base;
import io.sphere.sdk.models.Builder;
import java.util.List;
import javax.annotation.Generated;
/**
* Builder for {@link Trigger}.
*/
@Generated(
value = "io.sphere.sdk.annotations.processors.generators.HasBuilderGenerator",
comments = "Generated from: io.sphere.sdk.extensions.Trigger"
)
public final class TriggerBuilder extends Base implements Builder {
private List actions;
private ExtensionResourceType resourceTypeId;
TriggerBuilder() {
}
TriggerBuilder(final List actions, final ExtensionResourceType resourceTypeId) {
this.actions = actions;
this.resourceTypeId = resourceTypeId;
}
/**
* Sets the {@code actions} property of this builder.
*
* @param actions the value for {@link Trigger#getActions()}
* @return this builder
*/
public TriggerBuilder actions(final List actions) {
this.actions = actions;
return this;
}
/**
* Sets the {@code resourceTypeId} property of this builder.
*
* @param resourceTypeId the value for {@link Trigger#getResourceTypeId()}
* @return this builder
*/
public TriggerBuilder resourceTypeId(final ExtensionResourceType resourceTypeId) {
this.resourceTypeId = resourceTypeId;
return this;
}
/**
* Creates a new instance of {@code Trigger} with the values of this builder.
*
* @return the instance
*/
public Trigger build() {
return new TriggerImpl(actions, resourceTypeId);
}
/**
* Creates a new object initialized with the given values.
*
* @param resourceTypeId initial value for the {@link Trigger#getResourceTypeId()} property
* @param actions initial value for the {@link Trigger#getActions()} property
* @return new object initialized with the given values
*/
public static TriggerBuilder of(final ExtensionResourceType resourceTypeId,
final List actions) {
return new TriggerBuilder(actions, resourceTypeId);
}
/**
* 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 TriggerBuilder of(final Trigger template) {
return new TriggerBuilder(template.getActions(), template.getResourceTypeId());
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy