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