com.rosetta.jsonparsingtests.model.ExecutionDate Maven / Gradle / Ivy
package com.rosetta.jsonparsingtests.model;
import com.rosetta.jsonparsingtests.model.ExecutionDate;
import com.rosetta.jsonparsingtests.model.ExecutionDate.ExecutionDateBuilder;
import com.rosetta.jsonparsingtests.model.ExecutionDate.ExecutionDateBuilderImpl;
import com.rosetta.jsonparsingtests.model.ExecutionDate.ExecutionDateImpl;
import com.rosetta.jsonparsingtests.model.meta.ExecutionDateMeta;
import com.rosetta.model.lib.RosettaModelObject;
import com.rosetta.model.lib.RosettaModelObjectBuilder;
import com.rosetta.model.lib.annotations.RosettaAttribute;
import com.rosetta.model.lib.annotations.RosettaDataType;
import com.rosetta.model.lib.meta.RosettaMetaData;
import com.rosetta.model.lib.path.RosettaPath;
import com.rosetta.model.lib.process.BuilderMerger;
import com.rosetta.model.lib.process.BuilderProcessor;
import com.rosetta.model.lib.process.Processor;
import java.util.Objects;
import static java.util.Optional.ofNullable;
/**
* @version test
*/
@RosettaDataType(value="ExecutionDate", builder=ExecutionDate.ExecutionDateBuilderImpl.class, version="test")
public interface ExecutionDate extends RosettaModelObject {
ExecutionDateMeta metaData = new ExecutionDateMeta();
/*********************** Getter Methods ***********************/
String getDField();
/*********************** Build Methods ***********************/
ExecutionDate build();
ExecutionDate.ExecutionDateBuilder toBuilder();
static ExecutionDate.ExecutionDateBuilder builder() {
return new ExecutionDate.ExecutionDateBuilderImpl();
}
/*********************** Utility Methods ***********************/
@Override
default RosettaMetaData extends ExecutionDate> metaData() {
return metaData;
}
@Override
default Class extends ExecutionDate> getType() {
return ExecutionDate.class;
}
@Override
default void process(RosettaPath path, Processor processor) {
processor.processBasic(path.newSubPath("dField"), String.class, getDField(), this);
}
/*********************** Builder Interface ***********************/
interface ExecutionDateBuilder extends ExecutionDate, RosettaModelObjectBuilder {
ExecutionDate.ExecutionDateBuilder setDField(String dField);
@Override
default void process(RosettaPath path, BuilderProcessor processor) {
processor.processBasic(path.newSubPath("dField"), String.class, getDField(), this);
}
ExecutionDate.ExecutionDateBuilder prune();
}
/*********************** Immutable Implementation of ExecutionDate ***********************/
class ExecutionDateImpl implements ExecutionDate {
private final String dField;
protected ExecutionDateImpl(ExecutionDate.ExecutionDateBuilder builder) {
this.dField = builder.getDField();
}
@Override
@RosettaAttribute("dField")
public String getDField() {
return dField;
}
@Override
public ExecutionDate build() {
return this;
}
@Override
public ExecutionDate.ExecutionDateBuilder toBuilder() {
ExecutionDate.ExecutionDateBuilder builder = builder();
setBuilderFields(builder);
return builder;
}
protected void setBuilderFields(ExecutionDate.ExecutionDateBuilder builder) {
ofNullable(getDField()).ifPresent(builder::setDField);
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || !(o instanceof RosettaModelObject) || !getType().equals(((RosettaModelObject)o).getType())) return false;
ExecutionDate _that = getType().cast(o);
if (!Objects.equals(dField, _that.getDField())) return false;
return true;
}
@Override
public int hashCode() {
int _result = 0;
_result = 31 * _result + (dField != null ? dField.hashCode() : 0);
return _result;
}
@Override
public String toString() {
return "ExecutionDate {" +
"dField=" + this.dField +
'}';
}
}
/*********************** Builder Implementation of ExecutionDate ***********************/
class ExecutionDateBuilderImpl implements ExecutionDate.ExecutionDateBuilder {
protected String dField;
public ExecutionDateBuilderImpl() {
}
@Override
@RosettaAttribute("dField")
public String getDField() {
return dField;
}
@Override
@RosettaAttribute("dField")
public ExecutionDate.ExecutionDateBuilder setDField(String dField) {
this.dField = dField==null?null:dField;
return this;
}
@Override
public ExecutionDate build() {
return new ExecutionDate.ExecutionDateImpl(this);
}
@Override
public ExecutionDate.ExecutionDateBuilder toBuilder() {
return this;
}
@SuppressWarnings("unchecked")
@Override
public ExecutionDate.ExecutionDateBuilder prune() {
return this;
}
@Override
public boolean hasData() {
if (getDField()!=null) return true;
return false;
}
@SuppressWarnings("unchecked")
@Override
public ExecutionDate.ExecutionDateBuilder merge(RosettaModelObjectBuilder other, BuilderMerger merger) {
ExecutionDate.ExecutionDateBuilder o = (ExecutionDate.ExecutionDateBuilder) other;
merger.mergeBasic(getDField(), o.getDField(), this::setDField);
return this;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || !(o instanceof RosettaModelObject) || !getType().equals(((RosettaModelObject)o).getType())) return false;
ExecutionDate _that = getType().cast(o);
if (!Objects.equals(dField, _that.getDField())) return false;
return true;
}
@Override
public int hashCode() {
int _result = 0;
_result = 31 * _result + (dField != null ? dField.hashCode() : 0);
return _result;
}
@Override
public String toString() {
return "ExecutionDateBuilder {" +
"dField=" + this.dField +
'}';
}
}
}