org.isda.cdm.ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2 Maven / Gradle / Ivy
package org.isda.cdm;
import com.google.common.collect.ImmutableList;
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.util.ListEquals;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Consumer;
import java.util.stream.Collectors;
import org.isda.cdm.ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2;
import org.isda.cdm.ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2.ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2Builder;
import org.isda.cdm.ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2.ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2BuilderImpl;
import org.isda.cdm.ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2.ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2Impl;
import org.isda.cdm.meta.ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2Meta;
import static java.util.Optional.ofNullable;
/**
* @version test
*/
@RosettaDataType(value="ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2", builder=ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2.ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2BuilderImpl.class, version="test")
public interface ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2 extends RosettaModelObject {
ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2Meta metaData = new ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2Meta();
/*********************** Getter Methods ***********************/
List getAttributeWithSynonymPathExpression();
/*********************** Build Methods ***********************/
ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2 build();
ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2.ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2Builder toBuilder();
static ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2.ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2Builder builder() {
return new ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2.ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2BuilderImpl();
}
/*********************** Utility Methods ***********************/
@Override
default RosettaMetaData extends ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2> metaData() {
return metaData;
}
@Override
default Class extends ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2> getType() {
return ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2.class;
}
@Override
default void process(RosettaPath path, Processor processor) {
processor.processBasic(path.newSubPath("attributeWithSynonymPathExpression"), String.class, getAttributeWithSynonymPathExpression(), this);
}
/*********************** Builder Interface ***********************/
interface ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2Builder extends ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2, RosettaModelObjectBuilder {
ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2.ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2Builder addAttributeWithSynonymPathExpression(String attributeWithSynonymPathExpression0);
ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2.ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2Builder addAttributeWithSynonymPathExpression(String attributeWithSynonymPathExpression1, int _idx);
ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2.ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2Builder addAttributeWithSynonymPathExpression(List attributeWithSynonymPathExpression2);
ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2.ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2Builder setAttributeWithSynonymPathExpression(List attributeWithSynonymPathExpression3);
@Override
default void process(RosettaPath path, BuilderProcessor processor) {
processor.processBasic(path.newSubPath("attributeWithSynonymPathExpression"), String.class, getAttributeWithSynonymPathExpression(), this);
}
ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2.ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2Builder prune();
}
/*********************** Immutable Implementation of ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2 ***********************/
class ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2Impl implements ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2 {
private final List attributeWithSynonymPathExpression;
protected ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2Impl(ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2.ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2Builder builder) {
this.attributeWithSynonymPathExpression = ofNullable(builder.getAttributeWithSynonymPathExpression()).filter(_l->!_l.isEmpty()).map(ImmutableList::copyOf).orElse(null);
}
@Override
@RosettaAttribute("attributeWithSynonymPathExpression")
public List getAttributeWithSynonymPathExpression() {
return attributeWithSynonymPathExpression;
}
@Override
public ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2 build() {
return this;
}
@Override
public ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2.ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2Builder toBuilder() {
ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2.ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2Builder builder = builder();
setBuilderFields(builder);
return builder;
}
protected void setBuilderFields(ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2.ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2Builder builder) {
ofNullable(getAttributeWithSynonymPathExpression()).ifPresent(builder::setAttributeWithSynonymPathExpression);
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || !(o instanceof RosettaModelObject) || !getType().equals(((RosettaModelObject)o).getType())) return false;
ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2 _that = getType().cast(o);
if (!ListEquals.listEquals(attributeWithSynonymPathExpression, _that.getAttributeWithSynonymPathExpression())) return false;
return true;
}
@Override
public int hashCode() {
int _result = 0;
_result = 31 * _result + (attributeWithSynonymPathExpression != null ? attributeWithSynonymPathExpression.hashCode() : 0);
return _result;
}
@Override
public String toString() {
return "ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2 {" +
"attributeWithSynonymPathExpression=" + this.attributeWithSynonymPathExpression +
'}';
}
}
/*********************** Builder Implementation of ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2 ***********************/
class ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2BuilderImpl implements ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2.ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2Builder {
protected List attributeWithSynonymPathExpression = new ArrayList<>();
public ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2BuilderImpl() {
}
@Override
@RosettaAttribute("attributeWithSynonymPathExpression")
public List getAttributeWithSynonymPathExpression() {
return attributeWithSynonymPathExpression;
}
@Override
public ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2.ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2Builder addAttributeWithSynonymPathExpression(String attributeWithSynonymPathExpression) {
if (attributeWithSynonymPathExpression!=null) this.attributeWithSynonymPathExpression.add(attributeWithSynonymPathExpression);
return this;
}
@Override
public ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2.ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2Builder addAttributeWithSynonymPathExpression(String attributeWithSynonymPathExpression, int _idx) {
getIndex(this.attributeWithSynonymPathExpression, _idx, () -> attributeWithSynonymPathExpression);
return this;
}
@Override
public ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2.ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2Builder addAttributeWithSynonymPathExpression(List attributeWithSynonymPathExpressions) {
if (attributeWithSynonymPathExpressions != null) {
for (String toAdd : attributeWithSynonymPathExpressions) {
this.attributeWithSynonymPathExpression.add(toAdd);
}
}
return this;
}
@Override
@RosettaAttribute("attributeWithSynonymPathExpression")
public ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2.ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2Builder setAttributeWithSynonymPathExpression(List attributeWithSynonymPathExpressions) {
if (attributeWithSynonymPathExpressions == null) {
this.attributeWithSynonymPathExpression = new ArrayList<>();
}
else {
this.attributeWithSynonymPathExpression = attributeWithSynonymPathExpressions.stream()
.collect(Collectors.toCollection(()->new ArrayList<>()));
}
return this;
}
@Override
public ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2 build() {
return new ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2.ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2Impl(this);
}
@Override
public ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2.ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2Builder toBuilder() {
return this;
}
@SuppressWarnings("unchecked")
@Override
public ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2.ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2Builder prune() {
return this;
}
@Override
public boolean hasData() {
if (getAttributeWithSynonymPathExpression()!=null && !getAttributeWithSynonymPathExpression().isEmpty()) return true;
return false;
}
@SuppressWarnings("unchecked")
@Override
public ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2.ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2Builder merge(RosettaModelObjectBuilder other, BuilderMerger merger) {
ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2.ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2Builder o = (ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2.ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2Builder) other;
merger.mergeBasic(getAttributeWithSynonymPathExpression(), o.getAttributeWithSynonymPathExpression(), (Consumer) this::addAttributeWithSynonymPathExpression);
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;
ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2 _that = getType().cast(o);
if (!ListEquals.listEquals(attributeWithSynonymPathExpression, _that.getAttributeWithSynonymPathExpression())) return false;
return true;
}
@Override
public int hashCode() {
int _result = 0;
_result = 31 * _result + (attributeWithSynonymPathExpression != null ? attributeWithSynonymPathExpression.hashCode() : 0);
return _result;
}
@Override
public String toString() {
return "ShouldIgnorePathExpressionWhenNextInternalElementHasSynonym_2Builder {" +
"attributeWithSynonymPathExpression=" + this.attributeWithSynonymPathExpression +
'}';
}
}
}