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