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