Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.rosetta.jsonparsingtestschargor.model.metafields.ReferenceWithMetaPostingObligationsElection Maven / Gradle / Ivy
package com.rosetta.jsonparsingtestschargor.model.metafields;
import com.rosetta.jsonparsingtestschargor.model.PostingObligationsElection;
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.BasicRosettaMetaData;
import com.rosetta.model.lib.meta.Reference;
import com.rosetta.model.lib.meta.ReferenceWithMeta;
import com.rosetta.model.lib.meta.ReferenceWithMeta.ReferenceWithMetaBuilder;
import com.rosetta.model.lib.meta.RosettaMetaData;
import com.rosetta.model.lib.path.RosettaPath;
import com.rosetta.model.lib.process.AttributeMeta;
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 1
*/
@RosettaDataType(value="ReferenceWithMetaPostingObligationsElection", builder=ReferenceWithMetaPostingObligationsElection.ReferenceWithMetaPostingObligationsElectionBuilderImpl.class, version="0.0.0")
public interface ReferenceWithMetaPostingObligationsElection extends RosettaModelObject, ReferenceWithMeta {
ReferenceWithMetaPostingObligationsElectionMeta metaData = new ReferenceWithMetaPostingObligationsElectionMeta();
/*********************** Getter Methods ***********************/
PostingObligationsElection getValue();
String getGlobalReference();
String getExternalReference();
Reference getReference();
/*********************** Build Methods ***********************/
ReferenceWithMetaPostingObligationsElection build();
ReferenceWithMetaPostingObligationsElection.ReferenceWithMetaPostingObligationsElectionBuilder toBuilder();
static ReferenceWithMetaPostingObligationsElection.ReferenceWithMetaPostingObligationsElectionBuilder builder() {
return new ReferenceWithMetaPostingObligationsElection.ReferenceWithMetaPostingObligationsElectionBuilderImpl();
}
/*********************** Utility Methods ***********************/
@Override
default RosettaMetaData extends ReferenceWithMetaPostingObligationsElection> metaData() {
return metaData;
}
@Override
default Class extends ReferenceWithMetaPostingObligationsElection> getType() {
return ReferenceWithMetaPostingObligationsElection.class;
}
@Override
default Class getValueType() {
return PostingObligationsElection.class;
}
@Override
default void process(RosettaPath path, Processor processor) {
processRosetta(path.newSubPath("value"), processor, PostingObligationsElection.class, getValue());
processor.processBasic(path.newSubPath("globalReference"), String.class, getGlobalReference(), this, AttributeMeta.META);
processor.processBasic(path.newSubPath("externalReference"), String.class, getExternalReference(), this, AttributeMeta.META);
processRosetta(path.newSubPath("reference"), processor, Reference.class, getReference());
}
/*********************** Builder Interface ***********************/
interface ReferenceWithMetaPostingObligationsElectionBuilder extends ReferenceWithMetaPostingObligationsElection, RosettaModelObjectBuilder, ReferenceWithMeta.ReferenceWithMetaBuilder {
PostingObligationsElection.PostingObligationsElectionBuilder getOrCreateValue();
PostingObligationsElection.PostingObligationsElectionBuilder getValue();
Reference.ReferenceBuilder getOrCreateReference();
Reference.ReferenceBuilder getReference();
ReferenceWithMetaPostingObligationsElection.ReferenceWithMetaPostingObligationsElectionBuilder setValue(PostingObligationsElection value);
ReferenceWithMetaPostingObligationsElection.ReferenceWithMetaPostingObligationsElectionBuilder setGlobalReference(String globalReference);
ReferenceWithMetaPostingObligationsElection.ReferenceWithMetaPostingObligationsElectionBuilder setExternalReference(String externalReference);
ReferenceWithMetaPostingObligationsElection.ReferenceWithMetaPostingObligationsElectionBuilder setReference(Reference reference);
@Override
default void process(RosettaPath path, BuilderProcessor processor) {
processRosetta(path.newSubPath("value"), processor, PostingObligationsElection.PostingObligationsElectionBuilder.class, getValue());
processor.processBasic(path.newSubPath("globalReference"), String.class, getGlobalReference(), this, AttributeMeta.META);
processor.processBasic(path.newSubPath("externalReference"), String.class, getExternalReference(), this, AttributeMeta.META);
processRosetta(path.newSubPath("reference"), processor, Reference.ReferenceBuilder.class, getReference());
}
ReferenceWithMetaPostingObligationsElection.ReferenceWithMetaPostingObligationsElectionBuilder prune();
}
/*********************** Immutable Implementation of ReferenceWithMetaPostingObligationsElection ***********************/
class ReferenceWithMetaPostingObligationsElectionImpl implements ReferenceWithMetaPostingObligationsElection {
private final PostingObligationsElection value;
private final String globalReference;
private final String externalReference;
private final Reference reference;
protected ReferenceWithMetaPostingObligationsElectionImpl(ReferenceWithMetaPostingObligationsElection.ReferenceWithMetaPostingObligationsElectionBuilder builder) {
this.value = ofNullable(builder.getValue()).map(f->f.build()).orElse(null);
this.globalReference = builder.getGlobalReference();
this.externalReference = builder.getExternalReference();
this.reference = ofNullable(builder.getReference()).map(f->f.build()).orElse(null);
}
@Override
@RosettaAttribute("value")
public PostingObligationsElection getValue() {
return value;
}
@Override
@RosettaAttribute("globalReference")
public String getGlobalReference() {
return globalReference;
}
@Override
@RosettaAttribute("externalReference")
public String getExternalReference() {
return externalReference;
}
@Override
@RosettaAttribute("address")
public Reference getReference() {
return reference;
}
@Override
public ReferenceWithMetaPostingObligationsElection build() {
return this;
}
@Override
public ReferenceWithMetaPostingObligationsElection.ReferenceWithMetaPostingObligationsElectionBuilder toBuilder() {
ReferenceWithMetaPostingObligationsElection.ReferenceWithMetaPostingObligationsElectionBuilder builder = builder();
setBuilderFields(builder);
return builder;
}
protected void setBuilderFields(ReferenceWithMetaPostingObligationsElection.ReferenceWithMetaPostingObligationsElectionBuilder builder) {
ofNullable(getValue()).ifPresent(builder::setValue);
ofNullable(getGlobalReference()).ifPresent(builder::setGlobalReference);
ofNullable(getExternalReference()).ifPresent(builder::setExternalReference);
ofNullable(getReference()).ifPresent(builder::setReference);
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || !(o instanceof RosettaModelObject) || !getType().equals(((RosettaModelObject)o).getType())) return false;
ReferenceWithMetaPostingObligationsElection _that = getType().cast(o);
if (!Objects.equals(value, _that.getValue())) return false;
if (!Objects.equals(globalReference, _that.getGlobalReference())) return false;
if (!Objects.equals(externalReference, _that.getExternalReference())) return false;
if (!Objects.equals(reference, _that.getReference())) return false;
return true;
}
@Override
public int hashCode() {
int _result = 0;
_result = 31 * _result + (value != null ? value.hashCode() : 0);
_result = 31 * _result + (globalReference != null ? globalReference.hashCode() : 0);
_result = 31 * _result + (externalReference != null ? externalReference.hashCode() : 0);
_result = 31 * _result + (reference != null ? reference.hashCode() : 0);
return _result;
}
@Override
public String toString() {
return "ReferenceWithMetaPostingObligationsElection {" +
"value=" + this.value + ", " +
"globalReference=" + this.globalReference + ", " +
"externalReference=" + this.externalReference + ", " +
"reference=" + this.reference +
'}';
}
}
/*********************** Builder Implementation of ReferenceWithMetaPostingObligationsElection ***********************/
class ReferenceWithMetaPostingObligationsElectionBuilderImpl implements ReferenceWithMetaPostingObligationsElection.ReferenceWithMetaPostingObligationsElectionBuilder {
protected PostingObligationsElection.PostingObligationsElectionBuilder value;
protected String globalReference;
protected String externalReference;
protected Reference.ReferenceBuilder reference;
public ReferenceWithMetaPostingObligationsElectionBuilderImpl() {
}
@Override
@RosettaAttribute("value")
public PostingObligationsElection.PostingObligationsElectionBuilder getValue() {
return value;
}
@Override
public PostingObligationsElection.PostingObligationsElectionBuilder getOrCreateValue() {
PostingObligationsElection.PostingObligationsElectionBuilder result;
if (value!=null) {
result = value;
}
else {
result = value = PostingObligationsElection.builder();
}
return result;
}
@Override
@RosettaAttribute("globalReference")
public String getGlobalReference() {
return globalReference;
}
@Override
@RosettaAttribute("externalReference")
public String getExternalReference() {
return externalReference;
}
@Override
@RosettaAttribute("address")
public Reference.ReferenceBuilder getReference() {
return reference;
}
@Override
public Reference.ReferenceBuilder getOrCreateReference() {
Reference.ReferenceBuilder result;
if (reference!=null) {
result = reference;
}
else {
result = reference = Reference.builder();
}
return result;
}
@Override
@RosettaAttribute("value")
public ReferenceWithMetaPostingObligationsElection.ReferenceWithMetaPostingObligationsElectionBuilder setValue(PostingObligationsElection value) {
this.value = value==null?null:value.toBuilder();
return this;
}
@Override
@RosettaAttribute("globalReference")
public ReferenceWithMetaPostingObligationsElection.ReferenceWithMetaPostingObligationsElectionBuilder setGlobalReference(String globalReference) {
this.globalReference = globalReference==null?null:globalReference;
return this;
}
@Override
@RosettaAttribute("externalReference")
public ReferenceWithMetaPostingObligationsElection.ReferenceWithMetaPostingObligationsElectionBuilder setExternalReference(String externalReference) {
this.externalReference = externalReference==null?null:externalReference;
return this;
}
@Override
@RosettaAttribute("address")
public ReferenceWithMetaPostingObligationsElection.ReferenceWithMetaPostingObligationsElectionBuilder setReference(Reference reference) {
this.reference = reference==null?null:reference.toBuilder();
return this;
}
@Override
public ReferenceWithMetaPostingObligationsElection build() {
return new ReferenceWithMetaPostingObligationsElection.ReferenceWithMetaPostingObligationsElectionImpl(this);
}
@Override
public ReferenceWithMetaPostingObligationsElection.ReferenceWithMetaPostingObligationsElectionBuilder toBuilder() {
return this;
}
@SuppressWarnings("unchecked")
@Override
public ReferenceWithMetaPostingObligationsElection.ReferenceWithMetaPostingObligationsElectionBuilder prune() {
if (value!=null && !value.prune().hasData()) value = null;
if (reference!=null && !reference.prune().hasData()) reference = null;
return this;
}
@Override
public boolean hasData() {
if (getValue()!=null && getValue().hasData()) return true;
if (getGlobalReference()!=null) return true;
if (getExternalReference()!=null) return true;
if (getReference()!=null && getReference().hasData()) return true;
return false;
}
@SuppressWarnings("unchecked")
@Override
public ReferenceWithMetaPostingObligationsElection.ReferenceWithMetaPostingObligationsElectionBuilder merge(RosettaModelObjectBuilder other, BuilderMerger merger) {
ReferenceWithMetaPostingObligationsElection.ReferenceWithMetaPostingObligationsElectionBuilder o = (ReferenceWithMetaPostingObligationsElection.ReferenceWithMetaPostingObligationsElectionBuilder) other;
merger.mergeRosetta(getValue(), o.getValue(), this::setValue);
merger.mergeRosetta(getReference(), o.getReference(), this::setReference);
merger.mergeBasic(getGlobalReference(), o.getGlobalReference(), this::setGlobalReference);
merger.mergeBasic(getExternalReference(), o.getExternalReference(), this::setExternalReference);
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;
ReferenceWithMetaPostingObligationsElection _that = getType().cast(o);
if (!Objects.equals(value, _that.getValue())) return false;
if (!Objects.equals(globalReference, _that.getGlobalReference())) return false;
if (!Objects.equals(externalReference, _that.getExternalReference())) return false;
if (!Objects.equals(reference, _that.getReference())) return false;
return true;
}
@Override
public int hashCode() {
int _result = 0;
_result = 31 * _result + (value != null ? value.hashCode() : 0);
_result = 31 * _result + (globalReference != null ? globalReference.hashCode() : 0);
_result = 31 * _result + (externalReference != null ? externalReference.hashCode() : 0);
_result = 31 * _result + (reference != null ? reference.hashCode() : 0);
return _result;
}
@Override
public String toString() {
return "ReferenceWithMetaPostingObligationsElectionBuilder {" +
"value=" + this.value + ", " +
"globalReference=" + this.globalReference + ", " +
"externalReference=" + this.externalReference + ", " +
"reference=" + this.reference +
'}';
}
}
}
class ReferenceWithMetaPostingObligationsElectionMeta extends BasicRosettaMetaData{
}