io.sphere.sdk.models.AssetDraftDsl Maven / Gradle / Ivy
package io.sphere.sdk.models;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.sphere.sdk.types.CustomFieldsDraft;
import java.lang.String;
import java.util.List;
import java.util.Set;
import javax.annotation.Generated;
import javax.annotation.Nullable;
/**
* Dsl class for {@link AssetDraft}.
*/
@Generated(
value = "io.sphere.sdk.annotations.processors.generators.ResourceDraftValueGenerator",
comments = "Generated from: io.sphere.sdk.models.AssetDraft"
)
public final class AssetDraftDsl extends Base implements AssetDraft {
@Nullable
private CustomFieldsDraft custom;
@Nullable
private LocalizedString description;
private String key;
private LocalizedString name;
private List sources;
@Nullable
private Set tags;
@JsonCreator
AssetDraftDsl(@Nullable final CustomFieldsDraft custom,
@Nullable final LocalizedString description, final String key, final LocalizedString name,
final List sources, @Nullable final Set tags) {
this.custom = custom;
this.description = description;
this.key = key;
this.name = name;
this.sources = sources;
this.tags = tags;
}
@Nullable
public CustomFieldsDraft getCustom() {
return custom;
}
@Nullable
public LocalizedString getDescription() {
return description;
}
public String getKey() {
return key;
}
public LocalizedString getName() {
return name;
}
public List getSources() {
return sources;
}
@Nullable
public Set getTags() {
return tags;
}
/**
* Creates a new builder with the values of this object.
*
* @return new builder
*/
public AssetDraftBuilder newBuilder() {
return new AssetDraftBuilder(custom, description, key, name, sources, tags);
}
public AssetDraftDsl withCustom(@Nullable final CustomFieldsDraft custom) {
return newBuilder().custom(custom).build();
}
public AssetDraftDsl withDescription(@Nullable final LocalizedString description) {
return newBuilder().description(description).build();
}
public AssetDraftDsl withKey(final String key) {
return newBuilder().key(key).build();
}
public AssetDraftDsl withName(final LocalizedString name) {
return newBuilder().name(name).build();
}
public AssetDraftDsl withSources(final List sources) {
return newBuilder().sources(sources).build();
}
public AssetDraftDsl withTags(@Nullable final Set tags) {
return newBuilder().tags(tags).build();
}
/**
* Creates a new object initialized with the given values.
*
* @param sources initial value for the {@link AssetDraft#getSources()} property
* @param name initial value for the {@link AssetDraft#getName()} property
* @return new object initialized with the given values
*/
public static AssetDraftDsl of(final List sources, final LocalizedString name) {
return new AssetDraftDsl(null, null, null, name, sources, 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 AssetDraftDsl of(final AssetDraft template) {
return new AssetDraftDsl(template.getCustom(), template.getDescription(), template.getKey(), template.getName(), template.getSources(), template.getTags());
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy