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