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