io.sphere.sdk.reviews.ReviewDraftDsl Maven / Gradle / Ivy
package io.sphere.sdk.reviews;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.sphere.sdk.customers.Customer;
import io.sphere.sdk.models.Base;
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.util.Locale;
import javax.annotation.Generated;
import javax.annotation.Nullable;
/**
* Dsl class for {@link ReviewDraft}.
*/
@Generated(
value = "io.sphere.sdk.annotations.processors.generators.ResourceDraftValueGenerator",
comments = "Generated from: io.sphere.sdk.reviews.ReviewDraft"
)
public final class ReviewDraftDsl extends Base implements ReviewDraft {
@Nullable
private String authorName;
@Nullable
private CustomFieldsDraft custom;
@Nullable
private ResourceIdentifier customer;
@Nullable
private String key;
@Nullable
private Locale locale;
@Nullable
private Integer rating;
@Nullable
private ResourceIdentifier state;
@Nullable
private ResourceIdentifier> target;
@Nullable
private String text;
@Nullable
private String title;
@Nullable
private String uniquenessValue;
@JsonCreator
ReviewDraftDsl(@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;
}
@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 builder with the values of this object.
*
* @return new builder
*/
public ReviewDraftBuilder newBuilder() {
return new ReviewDraftBuilder(authorName, custom, customer, key, locale, rating, state, target, text, title, uniquenessValue);
}
public ReviewDraftDsl withAuthorName(@Nullable final String authorName) {
return newBuilder().authorName(authorName).build();
}
public ReviewDraftDsl withCustom(@Nullable final CustomFieldsDraft custom) {
return newBuilder().custom(custom).build();
}
public ReviewDraftDsl withCustomer(@Nullable final ResourceIdentifier customer) {
return newBuilder().customer(customer).build();
}
public ReviewDraftDsl withKey(@Nullable final String key) {
return newBuilder().key(key).build();
}
public ReviewDraftDsl withLocale(@Nullable final Locale locale) {
return newBuilder().locale(locale).build();
}
public ReviewDraftDsl withRating(@Nullable final Integer rating) {
return newBuilder().rating(rating).build();
}
public ReviewDraftDsl withState(@Nullable final ResourceIdentifier state) {
return newBuilder().state(state).build();
}
public ReviewDraftDsl withTarget(@Nullable final ResourceIdentifier> target) {
return newBuilder().target(target).build();
}
public ReviewDraftDsl withText(@Nullable final String text) {
return newBuilder().text(text).build();
}
public ReviewDraftDsl withTitle(@Nullable final String title) {
return newBuilder().title(title).build();
}
public ReviewDraftDsl withUniquenessValue(@Nullable final String uniquenessValue) {
return newBuilder().uniquenessValue(uniquenessValue).build();
}
/**
* 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 ReviewDraftDsl ofTitle(@Nullable final String title) {
return new ReviewDraftDsl(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 ReviewDraftDsl ofText(@Nullable final String text) {
return new ReviewDraftDsl(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 ReviewDraftDsl ofRating(@Nullable final Integer rating) {
return new ReviewDraftDsl(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 ReviewDraftDsl of(final ReviewDraft template) {
return new ReviewDraftDsl(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