com.rosetta.testconditional.model.W16 Maven / Gradle / Ivy
The newest version!
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.W16;
import com.rosetta.testconditional.model.W16.W16Builder;
import com.rosetta.testconditional.model.W16.W16BuilderImpl;
import com.rosetta.testconditional.model.W16.W16Impl;
import com.rosetta.testconditional.model.Y16;
import com.rosetta.testconditional.model.Y16.Y16Builder;
import com.rosetta.testconditional.model.meta.W16Meta;
import java.util.Objects;
import static java.util.Optional.ofNullable;
/**
* @version test
*/
@RosettaDataType(value="W16", builder=W16.W16BuilderImpl.class, version="test")
public interface W16 extends RosettaModelObject {
W16Meta metaData = new W16Meta();
/*********************** Getter Methods ***********************/
Y16 getYField();
/*********************** Build Methods ***********************/
W16 build();
W16.W16Builder toBuilder();
static W16.W16Builder builder() {
return new W16.W16BuilderImpl();
}
/*********************** Utility Methods ***********************/
@Override
default RosettaMetaData extends W16> metaData() {
return metaData;
}
@Override
default Class extends W16> getType() {
return W16.class;
}
@Override
default void process(RosettaPath path, Processor processor) {
processRosetta(path.newSubPath("yField"), processor, Y16.class, getYField());
}
/*********************** Builder Interface ***********************/
interface W16Builder extends W16, RosettaModelObjectBuilder {
Y16.Y16Builder getOrCreateYField();
@Override
Y16.Y16Builder getYField();
W16.W16Builder setYField(Y16 yField);
@Override
default void process(RosettaPath path, BuilderProcessor processor) {
processRosetta(path.newSubPath("yField"), processor, Y16.Y16Builder.class, getYField());
}
W16.W16Builder prune();
}
/*********************** Immutable Implementation of W16 ***********************/
class W16Impl implements W16 {
private final Y16 yField;
protected W16Impl(W16.W16Builder builder) {
this.yField = ofNullable(builder.getYField()).map(f->f.build()).orElse(null);
}
@Override
@RosettaAttribute("yField")
public Y16 getYField() {
return yField;
}
@Override
public W16 build() {
return this;
}
@Override
public W16.W16Builder toBuilder() {
W16.W16Builder builder = builder();
setBuilderFields(builder);
return builder;
}
protected void setBuilderFields(W16.W16Builder 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;
W16 _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.hashCode() : 0);
return _result;
}
@Override
public String toString() {
return "W16 {" +
"yField=" + this.yField +
'}';
}
}
/*********************** Builder Implementation of W16 ***********************/
class W16BuilderImpl implements W16.W16Builder {
protected Y16.Y16Builder yField;
@Override
@RosettaAttribute("yField")
public Y16.Y16Builder getYField() {
return yField;
}
@Override
public Y16.Y16Builder getOrCreateYField() {
Y16.Y16Builder result;
if (yField!=null) {
result = yField;
}
else {
result = yField = Y16.builder();
}
return result;
}
@Override
@RosettaAttribute("yField")
public W16.W16Builder setYField(Y16 _yField) {
this.yField = _yField == null ? null : _yField.toBuilder();
return this;
}
@Override
public W16 build() {
return new W16.W16Impl(this);
}
@Override
public W16.W16Builder toBuilder() {
return this;
}
@SuppressWarnings("unchecked")
@Override
public W16.W16Builder prune() {
if (yField!=null && !yField.prune().hasData()) yField = null;
return this;
}
@Override
public boolean hasData() {
if (getYField()!=null && getYField().hasData()) return true;
return false;
}
@SuppressWarnings("unchecked")
@Override
public W16.W16Builder merge(RosettaModelObjectBuilder other, BuilderMerger merger) {
W16.W16Builder o = (W16.W16Builder) other;
merger.mergeRosetta(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;
W16 _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.hashCode() : 0);
return _result;
}
@Override
public String toString() {
return "W16Builder {" +
"yField=" + this.yField +
'}';
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy