com.commercetools.history.models.change_value.ValidFromAndUntilValueBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of commercetools-sdk-java-history Show documentation
Show all versions of commercetools-sdk-java-history Show documentation
The e-commerce SDK from commercetools Composable Commerce for Java
package com.commercetools.history.models.change_value;
import java.util.*;
import io.vrap.rmf.base.client.Builder;
import io.vrap.rmf.base.client.utils.Generated;
/**
* ValidFromAndUntilValueBuilder
*
* Example to create an instance using the builder pattern
*
*
* ValidFromAndUntilValue validFromAndUntilValue = ValidFromAndUntilValue.builder()
* .validFrom("{validFrom}")
* .validUntil("{validUntil}")
* .build()
*
*
*/
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
public class ValidFromAndUntilValueBuilder implements Builder {
private String validFrom;
private String validUntil;
/**
* Date and time (UTC) from when the Discount is effective.
* @param validFrom value to be set
* @return Builder
*/
public ValidFromAndUntilValueBuilder validFrom(final String validFrom) {
this.validFrom = validFrom;
return this;
}
/**
* Date and time (UTC) until when the Discount is effective.
* @param validUntil value to be set
* @return Builder
*/
public ValidFromAndUntilValueBuilder validUntil(final String validUntil) {
this.validUntil = validUntil;
return this;
}
/**
* Date and time (UTC) from when the Discount is effective.
* @return validFrom
*/
public String getValidFrom() {
return this.validFrom;
}
/**
* Date and time (UTC) until when the Discount is effective.
* @return validUntil
*/
public String getValidUntil() {
return this.validUntil;
}
/**
* builds ValidFromAndUntilValue with checking for non-null required values
* @return ValidFromAndUntilValue
*/
public ValidFromAndUntilValue build() {
Objects.requireNonNull(validFrom, ValidFromAndUntilValue.class + ": validFrom is missing");
Objects.requireNonNull(validUntil, ValidFromAndUntilValue.class + ": validUntil is missing");
return new ValidFromAndUntilValueImpl(validFrom, validUntil);
}
/**
* builds ValidFromAndUntilValue without checking for non-null required values
* @return ValidFromAndUntilValue
*/
public ValidFromAndUntilValue buildUnchecked() {
return new ValidFromAndUntilValueImpl(validFrom, validUntil);
}
/**
* factory method for an instance of ValidFromAndUntilValueBuilder
* @return builder
*/
public static ValidFromAndUntilValueBuilder of() {
return new ValidFromAndUntilValueBuilder();
}
/**
* create builder for ValidFromAndUntilValue instance
* @param template instance with prefilled values for the builder
* @return builder
*/
public static ValidFromAndUntilValueBuilder of(final ValidFromAndUntilValue template) {
ValidFromAndUntilValueBuilder builder = new ValidFromAndUntilValueBuilder();
builder.validFrom = template.getValidFrom();
builder.validUntil = template.getValidUntil();
return builder;
}
}