com.rosetta.jsonparsingtests.model.DataBespokeProvisions Maven / Gradle / Ivy
package com.rosetta.jsonparsingtests.model;
import com.rosetta.jsonparsingtests.model.DataBespokeProvisions;
import com.rosetta.jsonparsingtests.model.DataBespokeProvisions.DataBespokeProvisionsBuilder;
import com.rosetta.jsonparsingtests.model.DataBespokeProvisions.DataBespokeProvisionsBuilderImpl;
import com.rosetta.jsonparsingtests.model.DataBespokeProvisions.DataBespokeProvisionsImpl;
import com.rosetta.jsonparsingtests.model.meta.DataBespokeProvisionsMeta;
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="DataBespokeProvisions", builder=DataBespokeProvisions.DataBespokeProvisionsBuilderImpl.class, version="test")
public interface DataBespokeProvisions extends RosettaModelObject {
DataBespokeProvisionsMeta metaData = new DataBespokeProvisionsMeta();
/*********************** Getter Methods ***********************/
String getAField();
/*********************** Build Methods ***********************/
DataBespokeProvisions build();
DataBespokeProvisions.DataBespokeProvisionsBuilder toBuilder();
static DataBespokeProvisions.DataBespokeProvisionsBuilder builder() {
return new DataBespokeProvisions.DataBespokeProvisionsBuilderImpl();
}
/*********************** Utility Methods ***********************/
@Override
default RosettaMetaData extends DataBespokeProvisions> metaData() {
return metaData;
}
@Override
default Class extends DataBespokeProvisions> getType() {
return DataBespokeProvisions.class;
}
@Override
default void process(RosettaPath path, Processor processor) {
processor.processBasic(path.newSubPath("aField"), String.class, getAField(), this);
}
/*********************** Builder Interface ***********************/
interface DataBespokeProvisionsBuilder extends DataBespokeProvisions, RosettaModelObjectBuilder {
DataBespokeProvisions.DataBespokeProvisionsBuilder setAField(String aField);
@Override
default void process(RosettaPath path, BuilderProcessor processor) {
processor.processBasic(path.newSubPath("aField"), String.class, getAField(), this);
}
DataBespokeProvisions.DataBespokeProvisionsBuilder prune();
}
/*********************** Immutable Implementation of DataBespokeProvisions ***********************/
class DataBespokeProvisionsImpl implements DataBespokeProvisions {
private final String aField;
protected DataBespokeProvisionsImpl(DataBespokeProvisions.DataBespokeProvisionsBuilder builder) {
this.aField = builder.getAField();
}
@Override
@RosettaAttribute("aField")
public String getAField() {
return aField;
}
@Override
public DataBespokeProvisions build() {
return this;
}
@Override
public DataBespokeProvisions.DataBespokeProvisionsBuilder toBuilder() {
DataBespokeProvisions.DataBespokeProvisionsBuilder builder = builder();
setBuilderFields(builder);
return builder;
}
protected void setBuilderFields(DataBespokeProvisions.DataBespokeProvisionsBuilder builder) {
ofNullable(getAField()).ifPresent(builder::setAField);
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || !(o instanceof RosettaModelObject) || !getType().equals(((RosettaModelObject)o).getType())) return false;
DataBespokeProvisions _that = getType().cast(o);
if (!Objects.equals(aField, _that.getAField())) return false;
return true;
}
@Override
public int hashCode() {
int _result = 0;
_result = 31 * _result + (aField != null ? aField.hashCode() : 0);
return _result;
}
@Override
public String toString() {
return "DataBespokeProvisions {" +
"aField=" + this.aField +
'}';
}
}
/*********************** Builder Implementation of DataBespokeProvisions ***********************/
class DataBespokeProvisionsBuilderImpl implements DataBespokeProvisions.DataBespokeProvisionsBuilder {
protected String aField;
public DataBespokeProvisionsBuilderImpl() {
}
@Override
@RosettaAttribute("aField")
public String getAField() {
return aField;
}
@Override
@RosettaAttribute("aField")
public DataBespokeProvisions.DataBespokeProvisionsBuilder setAField(String aField) {
this.aField = aField==null?null:aField;
return this;
}
@Override
public DataBespokeProvisions build() {
return new DataBespokeProvisions.DataBespokeProvisionsImpl(this);
}
@Override
public DataBespokeProvisions.DataBespokeProvisionsBuilder toBuilder() {
return this;
}
@SuppressWarnings("unchecked")
@Override
public DataBespokeProvisions.DataBespokeProvisionsBuilder prune() {
return this;
}
@Override
public boolean hasData() {
if (getAField()!=null) return true;
return false;
}
@SuppressWarnings("unchecked")
@Override
public DataBespokeProvisions.DataBespokeProvisionsBuilder merge(RosettaModelObjectBuilder other, BuilderMerger merger) {
DataBespokeProvisions.DataBespokeProvisionsBuilder o = (DataBespokeProvisions.DataBespokeProvisionsBuilder) other;
merger.mergeBasic(getAField(), o.getAField(), this::setAField);
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;
DataBespokeProvisions _that = getType().cast(o);
if (!Objects.equals(aField, _that.getAField())) return false;
return true;
}
@Override
public int hashCode() {
int _result = 0;
_result = 31 * _result + (aField != null ? aField.hashCode() : 0);
return _result;
}
@Override
public String toString() {
return "DataBespokeProvisionsBuilder {" +
"aField=" + this.aField +
'}';
}
}
}