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