All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.sphere.sdk.states.StateDraftDsl Maven / Gradle / Ivy

There is a newer version: 2.16.0
Show newest version
/*
This class has been generated by class io.sphere.sdk.annotations.processors.ResourceDraftValueAnnotationProcessor
induced by the annotation io.sphere.sdk.annotations.ResourceDraftValue.
in the source class io.sphere.sdk.states.StateDraft.

*/
package io.sphere.sdk.states;

import javax.annotation.Nullable;
import io.sphere.sdk.models.*;
import java.util.*;
import io.sphere.sdk.utils.*;
import com.fasterxml.jackson.annotation.*;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.sphere.sdk.states.StateDraftBuilder;


public final class StateDraftDsl extends io.sphere.sdk.models.Base implements StateDraft {
    private     final java.lang.String key;
    private     final io.sphere.sdk.states.StateType type;
    @Nullable()
    private     final io.sphere.sdk.models.LocalizedString name;
    @Nullable()
    private     final io.sphere.sdk.models.LocalizedString description;
    @Nullable() @JsonProperty("initial")
    private     final java.lang.Boolean initial;
    @Nullable()
    private     final java.util.Set> transitions;
    @Nullable()
    private     final java.util.Set roles;

    @JsonCreator()
    StateDraftDsl(final io.sphere.sdk.models.LocalizedString description, @com.fasterxml.jackson.annotation.JsonProperty("initial") final java.lang.Boolean initial, final java.lang.String key, final io.sphere.sdk.models.LocalizedString name, final java.util.Set roles, final java.util.Set> transitions, final io.sphere.sdk.states.StateType type) {
        
        this.description = description;
        this.initial = initial;
        this.key = key;
        this.name = name;
        this.roles = roles;
        this.transitions = transitions;
        this.type = type;
        
}
    
    
    @Nullable()
    public io.sphere.sdk.models.LocalizedString getDescription() {
        return description;
}
    
    @Nullable() @JsonProperty("initial")
    public java.lang.Boolean isInitial() {
        return initial;
}
    
    public java.lang.String getKey() {
        return key;
}
    
    @Nullable()
    public io.sphere.sdk.models.LocalizedString getName() {
        return name;
}
    
    @Nullable()
    public java.util.Set getRoles() {
        return roles;
}
    
    @Nullable()
    public java.util.Set> getTransitions() {
        return transitions;
}
    
    public io.sphere.sdk.states.StateType getType() {
        return type;
}
    
    public StateDraftDsl withKey(final java.lang.String key) {
        return newBuilder().key(key).build();
}
    
    public StateDraftDsl withType(final io.sphere.sdk.states.StateType type) {
        return newBuilder().type(type).build();
}
    
    public StateDraftDsl withName(@Nullable() final io.sphere.sdk.models.LocalizedString name) {
        return newBuilder().name(name).build();
}
    
    public StateDraftDsl withDescription(@Nullable() final io.sphere.sdk.models.LocalizedString description) {
        return newBuilder().description(description).build();
}
    
    public StateDraftDsl withInitial(@Nullable() final java.lang.Boolean initial) {
        return newBuilder().initial(initial).build();
}
    
    public StateDraftDsl withIsInitial(@Nullable() final java.lang.Boolean initial) {
        return newBuilder().initial(initial).build();
}
    
    public StateDraftDsl withTransitions(@Nullable() final java.util.Set> transitions) {
        return newBuilder().transitions(transitions).build();
}
    
    public StateDraftDsl withRoles(@Nullable() final java.util.Set roles) {
        return newBuilder().roles(roles).build();
}
    
    private StateDraftBuilder newBuilder() {
        return new StateDraftBuilder(description, initial, key, name, roles, transitions, type);
}
    
    public static StateDraftDsl of(final java.lang.String key, final io.sphere.sdk.states.StateType type) {
        return new StateDraftDsl(null, null, key, null, null, null, type);
}
    
    public static StateDraftDsl of(final StateDraft template) {
        return new StateDraftDsl(template.getDescription(), template.isInitial(), template.getKey(), template.getName(), template.getRoles(), template.getTransitions(), template.getType());
}
    
        public StateDraftDsl withRoles(final StateRole role) {
        return withRoles(Collections.singleton(role));
    }
    public StateDraftDsl withInitial(final boolean initial) {
        return newBuilder().initial(initial).build();
    } 
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy