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