com.logicommerce.sdk.builders.PeriodTimeBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sdk Show documentation
Show all versions of sdk Show documentation
SDK for developing Logicommerce plugins.
package com.logicommerce.sdk.builders;
import java.time.LocalTime;
import com.logicommerce.sdk.models.PeriodTime;
import com.logicommerce.sdk.models.implementations.PeriodTimeImpl;
/**
* PeriodDateBuilder class.
*
* @author Logicommerce
* @since 1.3.7
*/
public class PeriodTimeBuilder {
private T parentBuilder;
private LocalTime startDate;
private LocalTime endDate;
/**
* Constructor for PeriodDateBuilder.
*/
public PeriodTimeBuilder() {
}
/**
* Constructor for PeriodDateBuilder.
*
* @param parentBuilder a T object
*/
public PeriodTimeBuilder(T parentBuilder) {
this();
this.parentBuilder = parentBuilder;
}
/**
* startDate.
*
* @param startDate a {@link java.lang.String} object
* @return a {@link com.logicommerce.sdk.builders.PeriodTimeBuilder} object
*/
public PeriodTimeBuilder startDate(LocalTime startDate) {
this.startDate = startDate;
return returnThis();
}
/**
* endDate.
*
* @param endDate a {@link java.lang.String} object
* @return a {@link com.logicommerce.sdk.builders.PeriodTimeBuilder} object
*/
public PeriodTimeBuilder endDate(LocalTime endDate) {
this.endDate = endDate;
return returnThis();
}
/**
* build.
*
* @return a {@link com.logicommerce.sdk.models.PeriodDate} object
*/
public PeriodTime build() {
PeriodTimeImpl periodDate = new PeriodTimeImpl();
periodDate.setStartDate(startDate);
periodDate.setEndDate(endDate);
return periodDate;
}
/**
* done.
*
* @return a T object
*/
public T done() {
return parentBuilder;
}
/**
* returnThis.
*
* @return a {@link com.logicommerce.sdk.builders.PeriodTimeBuilder} object
*/
protected PeriodTimeBuilder returnThis() {
return this;
}
}