io.sphere.sdk.customergroups.CustomerGroupDraftBuilder Maven / Gradle / Ivy
package io.sphere.sdk.customergroups;
import io.sphere.sdk.models.Base;
import io.sphere.sdk.models.Builder;
import io.sphere.sdk.types.CustomFieldsDraft;
import java.lang.String;
import javax.annotation.Generated;
import javax.annotation.Nullable;
/**
* Builder for {@link CustomerGroupDraft}.
*/
@Generated(
value = "io.sphere.sdk.annotations.processors.generators.DraftBuilderGenerator",
comments = "Generated from: io.sphere.sdk.customergroups.CustomerGroupDraft"
)
public final class CustomerGroupDraftBuilder extends Base implements Builder {
@Nullable
private CustomFieldsDraft custom;
private String groupName;
@Nullable
private String key;
CustomerGroupDraftBuilder() {
}
CustomerGroupDraftBuilder(@Nullable final CustomFieldsDraft custom, final String groupName,
@Nullable final String key) {
this.custom = custom;
this.groupName = groupName;
this.key = key;
}
/**
* Sets the {@code custom} property of this builder.
*
* @param custom the value for {@link CustomerGroupDraft#getCustom()}
* @return this builder
*/
public CustomerGroupDraftBuilder custom(@Nullable final CustomFieldsDraft custom) {
this.custom = custom;
return this;
}
/**
* Sets the {@code groupName} property of this builder.
*
* @param groupName the value for {@link CustomerGroupDraft#getGroupName()}
* @return this builder
*/
public CustomerGroupDraftBuilder groupName(final String groupName) {
this.groupName = groupName;
return this;
}
/**
* Sets the {@code key} property of this builder.
*
* @param key the value for {@link CustomerGroupDraft#getKey()}
* @return this builder
*/
public CustomerGroupDraftBuilder key(@Nullable final String key) {
this.key = key;
return this;
}
@Nullable
public CustomFieldsDraft getCustom() {
return custom;
}
public String getGroupName() {
return groupName;
}
@Nullable
public String getKey() {
return key;
}
/**
* Creates a new instance of {@code CustomerGroupDraftDsl} with the values of this builder.
*
* @return the instance
*/
public CustomerGroupDraftDsl build() {
return new CustomerGroupDraftDsl(custom, groupName, key);
}
/**
* Creates a new object initialized with the given values.
*
* @param groupName initial value for the {@link CustomerGroupDraft#getGroupName()} property
* @return new object initialized with the given values
*/
public static CustomerGroupDraftBuilder of(final String groupName) {
return new CustomerGroupDraftBuilder(null, groupName, 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 CustomerGroupDraftBuilder of(final CustomerGroupDraft template) {
return new CustomerGroupDraftBuilder(template.getCustom(), template.getGroupName(), template.getKey());
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy