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