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