com.rosetta.testconditional.model.W24b 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.W24b;
import com.rosetta.testconditional.model.W24b.W24bBuilder;
import com.rosetta.testconditional.model.W24b.W24bBuilderImpl;
import com.rosetta.testconditional.model.W24b.W24bImpl;
import com.rosetta.testconditional.model.meta.W24bMeta;
import java.util.Objects;
import static java.util.Optional.ofNullable;
/**
* @version test
*/
@RosettaDataType(value="W24b", builder=W24b.W24bBuilderImpl.class, version="test")
public interface W24b extends RosettaModelObject {
W24bMeta metaData = new W24bMeta();
/*********************** Getter Methods ***********************/
String getXField();
/*********************** Build Methods ***********************/
W24b build();
W24b.W24bBuilder toBuilder();
static W24b.W24bBuilder builder() {
return new W24b.W24bBuilderImpl();
}
/*********************** Utility Methods ***********************/
@Override
default RosettaMetaData extends W24b> metaData() {
return metaData;
}
@Override
default Class extends W24b> getType() {
return W24b.class;
}
@Override
default void process(RosettaPath path, Processor processor) {
processor.processBasic(path.newSubPath("xField"), String.class, getXField(), this);
}
/*********************** Builder Interface ***********************/
interface W24bBuilder extends W24b, RosettaModelObjectBuilder {
W24b.W24bBuilder setXField(String xField);
@Override
default void process(RosettaPath path, BuilderProcessor processor) {
processor.processBasic(path.newSubPath("xField"), String.class, getXField(), this);
}
W24b.W24bBuilder prune();
}
/*********************** Immutable Implementation of W24b ***********************/
class W24bImpl implements W24b {
private final String xField;
protected W24bImpl(W24b.W24bBuilder builder) {
this.xField = builder.getXField();
}
@Override
@RosettaAttribute("xField")
public String getXField() {
return xField;
}
@Override
public W24b build() {
return this;
}
@Override
public W24b.W24bBuilder toBuilder() {
W24b.W24bBuilder builder = builder();
setBuilderFields(builder);
return builder;
}
protected void setBuilderFields(W24b.W24bBuilder builder) {
ofNullable(getXField()).ifPresent(builder::setXField);
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || !(o instanceof RosettaModelObject) || !getType().equals(((RosettaModelObject)o).getType())) return false;
W24b _that = getType().cast(o);
if (!Objects.equals(xField, _that.getXField())) return false;
return true;
}
@Override
public int hashCode() {
int _result = 0;
_result = 31 * _result + (xField != null ? xField.hashCode() : 0);
return _result;
}
@Override
public String toString() {
return "W24b {" +
"xField=" + this.xField +
'}';
}
}
/*********************** Builder Implementation of W24b ***********************/
class W24bBuilderImpl implements W24b.W24bBuilder {
protected String xField;
public W24bBuilderImpl() {
}
@Override
@RosettaAttribute("xField")
public String getXField() {
return xField;
}
@Override
@RosettaAttribute("xField")
public W24b.W24bBuilder setXField(String xField) {
this.xField = xField==null?null:xField;
return this;
}
@Override
public W24b build() {
return new W24b.W24bImpl(this);
}
@Override
public W24b.W24bBuilder toBuilder() {
return this;
}
@SuppressWarnings("unchecked")
@Override
public W24b.W24bBuilder prune() {
return this;
}
@Override
public boolean hasData() {
if (getXField()!=null) return true;
return false;
}
@SuppressWarnings("unchecked")
@Override
public W24b.W24bBuilder merge(RosettaModelObjectBuilder other, BuilderMerger merger) {
W24b.W24bBuilder o = (W24b.W24bBuilder) other;
merger.mergeBasic(getXField(), o.getXField(), this::setXField);
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;
W24b _that = getType().cast(o);
if (!Objects.equals(xField, _that.getXField())) return false;
return true;
}
@Override
public int hashCode() {
int _result = 0;
_result = 31 * _result + (xField != null ? xField.hashCode() : 0);
return _result;
}
@Override
public String toString() {
return "W24bBuilder {" +
"xField=" + this.xField +
'}';
}
}
}