com.commercetools.importapi.models.common.StateKeyReferenceBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of commercetools-sdk-java-importapi Show documentation
Show all versions of commercetools-sdk-java-importapi Show documentation
The e-commerce SDK from commercetools Composable Commerce for Java
package com.commercetools.importapi.models.common;
import java.util.*;
import io.vrap.rmf.base.client.Builder;
import io.vrap.rmf.base.client.utils.Generated;
/**
* StateKeyReferenceBuilder
*
* Example to create an instance using the builder pattern
*
*
* StateKeyReference stateKeyReference = StateKeyReference.builder()
* .key("{key}")
* .build()
*
*
*/
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
public class StateKeyReferenceBuilder implements Builder {
private String key;
/**
* set the value to the key
* @param key value to be set
* @return Builder
*/
public StateKeyReferenceBuilder key(final String key) {
this.key = key;
return this;
}
/**
* value of key}
* @return key
*/
public String getKey() {
return this.key;
}
/**
* builds StateKeyReference with checking for non-null required values
* @return StateKeyReference
*/
public StateKeyReference build() {
Objects.requireNonNull(key, StateKeyReference.class + ": key is missing");
return new StateKeyReferenceImpl(key);
}
/**
* builds StateKeyReference without checking for non-null required values
* @return StateKeyReference
*/
public StateKeyReference buildUnchecked() {
return new StateKeyReferenceImpl(key);
}
/**
* factory method for an instance of StateKeyReferenceBuilder
* @return builder
*/
public static StateKeyReferenceBuilder of() {
return new StateKeyReferenceBuilder();
}
/**
* create builder for StateKeyReference instance
* @param template instance with prefilled values for the builder
* @return builder
*/
public static StateKeyReferenceBuilder of(final StateKeyReference template) {
StateKeyReferenceBuilder builder = new StateKeyReferenceBuilder();
builder.key = template.getKey();
return builder;
}
}