com.rosetta.testconditional.model.Y26_3 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_3;
import com.rosetta.testconditional.model.Y26_3.Y26_3Builder;
import com.rosetta.testconditional.model.Y26_3.Y26_3BuilderImpl;
import com.rosetta.testconditional.model.Y26_3.Y26_3Impl;
import com.rosetta.testconditional.model.meta.Y26_3Meta;
import java.util.Objects;
import static java.util.Optional.ofNullable;
/**
* @version test
*/
@RosettaDataType(value="Y26_3", builder=Y26_3.Y26_3BuilderImpl.class, version="test")
public interface Y26_3 extends RosettaModelObject {
Y26_3Meta metaData = new Y26_3Meta();
/*********************** Getter Methods ***********************/
TestEnum getZField();
/*********************** Build Methods ***********************/
Y26_3 build();
Y26_3.Y26_3Builder toBuilder();
static Y26_3.Y26_3Builder builder() {
return new Y26_3.Y26_3BuilderImpl();
}
/*********************** Utility Methods ***********************/
@Override
default RosettaMetaData extends Y26_3> metaData() {
return metaData;
}
@Override
default Class extends Y26_3> getType() {
return Y26_3.class;
}
@Override
default void process(RosettaPath path, Processor processor) {
processor.processBasic(path.newSubPath("zField"), TestEnum.class, getZField(), this);
}
/*********************** Builder Interface ***********************/
interface Y26_3Builder extends Y26_3, RosettaModelObjectBuilder {
Y26_3.Y26_3Builder setZField(TestEnum zField);
@Override
default void process(RosettaPath path, BuilderProcessor processor) {
processor.processBasic(path.newSubPath("zField"), TestEnum.class, getZField(), this);
}
Y26_3.Y26_3Builder prune();
}
/*********************** Immutable Implementation of Y26_3 ***********************/
class Y26_3Impl implements Y26_3 {
private final TestEnum zField;
protected Y26_3Impl(Y26_3.Y26_3Builder builder) {
this.zField = builder.getZField();
}
@Override
@RosettaAttribute("zField")
public TestEnum getZField() {
return zField;
}
@Override
public Y26_3 build() {
return this;
}
@Override
public Y26_3.Y26_3Builder toBuilder() {
Y26_3.Y26_3Builder builder = builder();
setBuilderFields(builder);
return builder;
}
protected void setBuilderFields(Y26_3.Y26_3Builder 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_3 _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_3 {" +
"zField=" + this.zField +
'}';
}
}
/*********************** Builder Implementation of Y26_3 ***********************/
class Y26_3BuilderImpl implements Y26_3.Y26_3Builder {
protected TestEnum zField;
public Y26_3BuilderImpl() {
}
@Override
@RosettaAttribute("zField")
public TestEnum getZField() {
return zField;
}
@Override
@RosettaAttribute("zField")
public Y26_3.Y26_3Builder setZField(TestEnum zField) {
this.zField = zField==null?null:zField;
return this;
}
@Override
public Y26_3 build() {
return new Y26_3.Y26_3Impl(this);
}
@Override
public Y26_3.Y26_3Builder toBuilder() {
return this;
}
@SuppressWarnings("unchecked")
@Override
public Y26_3.Y26_3Builder prune() {
return this;
}
@Override
public boolean hasData() {
if (getZField()!=null) return true;
return false;
}
@SuppressWarnings("unchecked")
@Override
public Y26_3.Y26_3Builder merge(RosettaModelObjectBuilder other, BuilderMerger merger) {
Y26_3.Y26_3Builder o = (Y26_3.Y26_3Builder) 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_3 _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_3Builder {" +
"zField=" + this.zField +
'}';
}
}
}