io.sphere.sdk.customergroups.CustomerGroupDraftDsl Maven / Gradle / Ivy
package io.sphere.sdk.customergroups;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.sphere.sdk.models.Base;
import io.sphere.sdk.types.CustomFieldsDraft;
import java.lang.String;
import javax.annotation.Generated;
import javax.annotation.Nullable;
/**
* Dsl class for {@link CustomerGroupDraft}.
*/
@Generated(
value = "io.sphere.sdk.annotations.processors.generators.ResourceDraftValueGenerator",
comments = "Generated from: io.sphere.sdk.customergroups.CustomerGroupDraft"
)
public final class CustomerGroupDraftDsl extends Base implements CustomerGroupDraft {
@Nullable
private CustomFieldsDraft custom;
private String groupName;
@Nullable
private String key;
@JsonCreator
CustomerGroupDraftDsl(@Nullable final CustomFieldsDraft custom, final String groupName,
@Nullable final String key) {
this.custom = custom;
this.groupName = groupName;
this.key = key;
}
@Nullable
public CustomFieldsDraft getCustom() {
return custom;
}
public String getGroupName() {
return groupName;
}
@Nullable
public String getKey() {
return key;
}
/**
* Creates a new builder with the values of this object.
*
* @return new builder
*/
public CustomerGroupDraftBuilder newBuilder() {
return new CustomerGroupDraftBuilder(custom, groupName, key);
}
public CustomerGroupDraftDsl withCustom(@Nullable final CustomFieldsDraft custom) {
return newBuilder().custom(custom).build();
}
public CustomerGroupDraftDsl withGroupName(final String groupName) {
return newBuilder().groupName(groupName).build();
}
public CustomerGroupDraftDsl withKey(@Nullable final String key) {
return newBuilder().key(key).build();
}
/**
* 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 CustomerGroupDraftDsl of(final String groupName) {
return new CustomerGroupDraftDsl(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 CustomerGroupDraftDsl of(final CustomerGroupDraft template) {
return new CustomerGroupDraftDsl(template.getCustom(), template.getGroupName(), template.getKey());
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy