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