io.sphere.sdk.reviews.ReviewDraftBuilderBase Maven / Gradle / Ivy
package io.sphere.sdk.reviews;
import io.sphere.sdk.customers.Customer;
import io.sphere.sdk.models.Base;
import io.sphere.sdk.models.Builder;
import io.sphere.sdk.models.ResourceIdentifier;
import io.sphere.sdk.states.State;
import io.sphere.sdk.types.CustomFieldsDraft;
import java.lang.Integer;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.Locale;
import javax.annotation.Generated;
import javax.annotation.Nullable;
/**
* Abstract base builder for {@link ReviewDraft} which needs to be extended to add additional methods.
* Subclasses have to provide the same non-default constructor as this class.
*/
@Generated(
value = "io.sphere.sdk.annotations.processors.generators.DraftBuilderGenerator",
comments = "Generated from: io.sphere.sdk.reviews.ReviewDraft"
)
abstract class ReviewDraftBuilderBase extends Base implements Builder {
@Nullable
String authorName;
@Nullable
CustomFieldsDraft custom;
@Nullable
ResourceIdentifier customer;
@Nullable
String key;
@Nullable
Locale locale;
@Nullable
Integer rating;
@Nullable
ResourceIdentifier state;
@Nullable
ResourceIdentifier> target;
@Nullable
String text;
@Nullable
String title;
@Nullable
String uniquenessValue;
protected ReviewDraftBuilderBase() {
}
protected ReviewDraftBuilderBase(@Nullable final String authorName,
@Nullable final CustomFieldsDraft custom,
@Nullable final ResourceIdentifier customer, @Nullable final String key,
@Nullable final Locale locale, @Nullable final Integer rating,
@Nullable final ResourceIdentifier state, @Nullable final ResourceIdentifier> target,
@Nullable final String text, @Nullable final String title,
@Nullable final String uniquenessValue) {
this.authorName = authorName;
this.custom = custom;
this.customer = customer;
this.key = key;
this.locale = locale;
this.rating = rating;
this.state = state;
this.target = target;
this.text = text;
this.title = title;
this.uniquenessValue = uniquenessValue;
}
/**
* Sets the {@code authorName} property of this builder.
*
* @param authorName the value for {@link ReviewDraft#getAuthorName()}
* @return this builder
*/
@SuppressWarnings("unchecked")
public T authorName(@Nullable final String authorName) {
this.authorName = authorName;
return (T) this;
}
/**
* Sets the {@code custom} property of this builder.
*
* @param custom the value for {@link ReviewDraft#getCustom()}
* @return this builder
*/
@SuppressWarnings("unchecked")
public T custom(@Nullable final CustomFieldsDraft custom) {
this.custom = custom;
return (T) this;
}
/**
* Sets the {@code customer} property of this builder.
*
* @param customer the value for {@link ReviewDraft#getCustomer()}
* @return this builder
*/
@SuppressWarnings("unchecked")
public T customer(@Nullable final ResourceIdentifier customer) {
this.customer = customer;
return (T) this;
}
/**
* Sets the {@code key} property of this builder.
*
* @param key the value for {@link ReviewDraft#getKey()}
* @return this builder
*/
@SuppressWarnings("unchecked")
public T key(@Nullable final String key) {
this.key = key;
return (T) this;
}
/**
* Sets the {@code locale} property of this builder.
*
* @param locale the value for {@link ReviewDraft#getLocale()}
* @return this builder
*/
@SuppressWarnings("unchecked")
public T locale(@Nullable final Locale locale) {
this.locale = locale;
return (T) this;
}
/**
* Sets the {@code rating} property of this builder.
*
* @param rating the value for {@link ReviewDraft#getRating()}
* @return this builder
*/
@SuppressWarnings("unchecked")
public T rating(@Nullable final Integer rating) {
this.rating = rating;
return (T) this;
}
/**
* Sets the {@code state} property of this builder.
*
* @param state the value for {@link ReviewDraft#getState()}
* @return this builder
*/
@SuppressWarnings("unchecked")
public T state(@Nullable final ResourceIdentifier state) {
this.state = state;
return (T) this;
}
/**
* Sets the {@code target} property of this builder.
*
* @param target the value for {@link ReviewDraft#getTarget()}
* @return this builder
*/
@SuppressWarnings("unchecked")
public T target(@Nullable final ResourceIdentifier> target) {
this.target = target;
return (T) this;
}
/**
* Sets the {@code text} property of this builder.
*
* @param text the value for {@link ReviewDraft#getText()}
* @return this builder
*/
@SuppressWarnings("unchecked")
public T text(@Nullable final String text) {
this.text = text;
return (T) this;
}
/**
* Sets the {@code title} property of this builder.
*
* @param title the value for {@link ReviewDraft#getTitle()}
* @return this builder
*/
@SuppressWarnings("unchecked")
public T title(@Nullable final String title) {
this.title = title;
return (T) this;
}
/**
* Sets the {@code uniquenessValue} property of this builder.
*
* @param uniquenessValue the value for {@link ReviewDraft#getUniquenessValue()}
* @return this builder
*/
@SuppressWarnings("unchecked")
public T uniquenessValue(@Nullable final String uniquenessValue) {
this.uniquenessValue = uniquenessValue;
return (T) this;
}
@Nullable
public String getAuthorName() {
return authorName;
}
@Nullable
public CustomFieldsDraft getCustom() {
return custom;
}
@Nullable
public ResourceIdentifier getCustomer() {
return customer;
}
@Nullable
public String getKey() {
return key;
}
@Nullable
public Locale getLocale() {
return locale;
}
@Nullable
public Integer getRating() {
return rating;
}
@Nullable
public ResourceIdentifier getState() {
return state;
}
@Nullable
public ResourceIdentifier> getTarget() {
return target;
}
@Nullable
public String getText() {
return text;
}
@Nullable
public String getTitle() {
return title;
}
@Nullable
public String getUniquenessValue() {
return uniquenessValue;
}
/**
* Creates a new instance of {@code ReviewDraftDsl} with the values of this builder.
*
* @return the instance
*/
public ReviewDraftDsl build() {
return new ReviewDraftDsl(authorName, custom, customer, key, locale, rating, state, target, text, title, uniquenessValue);
}
/**
* Creates a new object initialized with the given values.
*
* @param title initial value for the {@link ReviewDraft#getTitle()} property
* @return new object initialized with the given values
*/
public static ReviewDraftBuilder ofTitle(@Nullable final String title) {
return new ReviewDraftBuilder(null, null, null, null, null, null, null, null, null, title, null);
}
/**
* Creates a new object initialized with the given values.
*
* @param text initial value for the {@link ReviewDraft#getText()} property
* @return new object initialized with the given values
*/
public static ReviewDraftBuilder ofText(@Nullable final String text) {
return new ReviewDraftBuilder(null, null, null, null, null, null, null, null, text, null, null);
}
/**
* Creates a new object initialized with the given values.
*
* @param rating initial value for the {@link ReviewDraft#getRating()} property
* @return new object initialized with the given values
*/
public static ReviewDraftBuilder ofRating(@Nullable final Integer rating) {
return new ReviewDraftBuilder(null, null, null, null, null, rating, null, null, null, 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 ReviewDraftBuilder of(final ReviewDraft template) {
return new ReviewDraftBuilder(template.getAuthorName(), template.getCustom(), template.getCustomer(), template.getKey(), template.getLocale(), template.getRating(), template.getState(), template.getTarget(), template.getText(), template.getTitle(), template.getUniquenessValue());
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy