com.rosetta.mappingprocessortest.model.Z10b Maven / Gradle / Ivy
package com.rosetta.mappingprocessortest.model;
import com.rosetta.mappingprocessortest.model.Z10b;
import com.rosetta.mappingprocessortest.model.Z10b.Z10bBuilder;
import com.rosetta.mappingprocessortest.model.Z10b.Z10bBuilderImpl;
import com.rosetta.mappingprocessortest.model.Z10b.Z10bImpl;
import com.rosetta.mappingprocessortest.model.meta.Z10bMeta;
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 java.util.Objects;
import static java.util.Optional.ofNullable;
/**
* @version test
*/
@RosettaDataType(value="Z10b", builder=Z10b.Z10bBuilderImpl.class, version="test")
public interface Z10b extends RosettaModelObject {
Z10bMeta metaData = new Z10bMeta();
/*********************** Getter Methods ***********************/
String getStrField();
/*********************** Build Methods ***********************/
Z10b build();
Z10b.Z10bBuilder toBuilder();
static Z10b.Z10bBuilder builder() {
return new Z10b.Z10bBuilderImpl();
}
/*********************** Utility Methods ***********************/
@Override
default RosettaMetaData extends Z10b> metaData() {
return metaData;
}
@Override
default Class extends Z10b> getType() {
return Z10b.class;
}
@Override
default void process(RosettaPath path, Processor processor) {
processor.processBasic(path.newSubPath("strField"), String.class, getStrField(), this);
}
/*********************** Builder Interface ***********************/
interface Z10bBuilder extends Z10b, RosettaModelObjectBuilder {
Z10b.Z10bBuilder setStrField(String strField);
@Override
default void process(RosettaPath path, BuilderProcessor processor) {
processor.processBasic(path.newSubPath("strField"), String.class, getStrField(), this);
}
Z10b.Z10bBuilder prune();
}
/*********************** Immutable Implementation of Z10b ***********************/
class Z10bImpl implements Z10b {
private final String strField;
protected Z10bImpl(Z10b.Z10bBuilder builder) {
this.strField = builder.getStrField();
}
@Override
@RosettaAttribute("strField")
public String getStrField() {
return strField;
}
@Override
public Z10b build() {
return this;
}
@Override
public Z10b.Z10bBuilder toBuilder() {
Z10b.Z10bBuilder builder = builder();
setBuilderFields(builder);
return builder;
}
protected void setBuilderFields(Z10b.Z10bBuilder builder) {
ofNullable(getStrField()).ifPresent(builder::setStrField);
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || !(o instanceof RosettaModelObject) || !getType().equals(((RosettaModelObject)o).getType())) return false;
Z10b _that = getType().cast(o);
if (!Objects.equals(strField, _that.getStrField())) return false;
return true;
}
@Override
public int hashCode() {
int _result = 0;
_result = 31 * _result + (strField != null ? strField.hashCode() : 0);
return _result;
}
@Override
public String toString() {
return "Z10b {" +
"strField=" + this.strField +
'}';
}
}
/*********************** Builder Implementation of Z10b ***********************/
class Z10bBuilderImpl implements Z10b.Z10bBuilder {
protected String strField;
@Override
@RosettaAttribute("strField")
public String getStrField() {
return strField;
}
@Override
@RosettaAttribute("strField")
public Z10b.Z10bBuilder setStrField(String _strField) {
this.strField = _strField == null ? null : _strField;
return this;
}
@Override
public Z10b build() {
return new Z10b.Z10bImpl(this);
}
@Override
public Z10b.Z10bBuilder toBuilder() {
return this;
}
@SuppressWarnings("unchecked")
@Override
public Z10b.Z10bBuilder prune() {
return this;
}
@Override
public boolean hasData() {
if (getStrField()!=null) return true;
return false;
}
@SuppressWarnings("unchecked")
@Override
public Z10b.Z10bBuilder merge(RosettaModelObjectBuilder other, BuilderMerger merger) {
Z10b.Z10bBuilder o = (Z10b.Z10bBuilder) other;
merger.mergeBasic(getStrField(), o.getStrField(), this::setStrField);
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;
Z10b _that = getType().cast(o);
if (!Objects.equals(strField, _that.getStrField())) return false;
return true;
}
@Override
public int hashCode() {
int _result = 0;
_result = 31 * _result + (strField != null ? strField.hashCode() : 0);
return _result;
}
@Override
public String toString() {
return "Z10bBuilder {" +
"strField=" + this.strField +
'}';
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy