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