org.finos.legend.pure.generated.Root_meta_external_store_service_tests_domain_Trader_Impl Maven / Gradle / Ivy
The newest version!
package org.finos.legend.pure.generated;
import org.eclipse.collections.api.RichIterable;
import org.eclipse.collections.api.factory.Lists;
import org.eclipse.collections.api.factory.Maps;
import org.eclipse.collections.api.list.ListIterable;
import org.eclipse.collections.api.list.MutableList;
import org.eclipse.collections.api.map.MutableMap;
import org.finos.legend.pure.m3.execution.ExecutionSupport;
import org.finos.legend.pure.m4.ModelRepository;
import org.finos.legend.pure.m4.coreinstance.CoreInstance;
import org.finos.legend.pure.m4.coreinstance.SourceInformation;
import org.finos.legend.pure.m4.coreinstance.factory.CoreInstanceFactory;
import org.finos.legend.pure.runtime.java.compiled.execution.*;
import org.finos.legend.pure.runtime.java.compiled.execution.sourceInformation.E_;
import org.finos.legend.pure.runtime.java.compiled.generation.processors.support.*;
import org.finos.legend.pure.runtime.java.compiled.generation.processors.support.coreinstance.ReflectiveCoreInstance;
import org.finos.legend.pure.runtime.java.compiled.generation.processors.support.coreinstance.ValCoreInstance;
import org.finos.legend.pure.runtime.java.compiled.generation.processors.support.coreinstance.GetterOverrideExecutor;
import org.finos.legend.pure.runtime.java.compiled.generation.processors.support.function.*;
import org.finos.legend.pure.runtime.java.compiled.generation.processors.support.function.defended.*;
public class Root_meta_external_store_service_tests_domain_Trader_Impl extends Root_meta_pure_metamodel_type_Any_Impl implements Root_meta_external_store_service_tests_domain_Trader
{
public static final String tempTypeName = "Trader";
private static final String tempFullTypeId = "Root::meta::external::store::service::tests::domain::Trader";
private static final KeyIndex KEY_INDEX = keyIndexBuilder(6)
.withKeys(tempFullTypeId, "firstName", "kerberos", "lastName")
.withKeyFromAssociation(tempFullTypeId, "trades")
.withKeys("Root::meta::pure::metamodel::type::Any", "classifierGenericType", "elementOverride")
.build();
private CoreInstance classifier;
public Root_meta_external_store_service_tests_domain_Trader_Impl(String id)
{
super(id);
}
public Root_meta_external_store_service_tests_domain_Trader_Impl(String name, SourceInformation sourceInformation, CoreInstance classifier)
{
this(name == null ? "Anonymous_NoCounter": name);
this.setSourceInformation(sourceInformation);
this.classifier = classifier;
}
@Override
public CoreInstance getClassifier()
{
return this.classifier;
}
@Override
public RichIterable getKeys()
{
return KEY_INDEX.getKeys();
}
@Override
public ListIterable getRealKeyByName(String name)
{
return KEY_INDEX.getRealKeyByName(name);
}
@Override
public CoreInstance getValueForMetaPropertyToOne(String keyName)
{
switch (keyName)
{
case "classifierGenericType":
{
return ValCoreInstance.toCoreInstance(_classifierGenericType());
}
case "elementOverride":
{
return ValCoreInstance.toCoreInstance(_elementOverride());
}
case "firstName":
{
return ValCoreInstance.toCoreInstance(_firstName());
}
case "kerberos":
{
return ValCoreInstance.toCoreInstance(_kerberos());
}
case "lastName":
{
return ValCoreInstance.toCoreInstance(_lastName());
}
default:
{
return super.getValueForMetaPropertyToOne(keyName);
}
}
}
@Override
public ListIterable getValueForMetaPropertyToMany(String keyName)
{
return "trades".equals(keyName) ? ValCoreInstance.toCoreInstances(_trades()) : super.getValueForMetaPropertyToMany(keyName);
}
public java.lang.String _lastName;
public Root_meta_external_store_service_tests_domain_Trader _lastName(java.lang.String val)
{
this._lastName = val;
return this;
}
public Root_meta_external_store_service_tests_domain_Trader _lastName(RichIterable val)
{
return _lastName(val.getFirst());
}
public Root_meta_external_store_service_tests_domain_Trader _lastNameRemove()
{
this._lastName = null;
return this;
}
public java.lang.String _lastName()
{
return this._lastName;
}
public Root_meta_external_store_service_tests_domain_Trader _elementOverride(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.ElementOverride val)
{
this._elementOverride = val;
return this;
}
public Root_meta_external_store_service_tests_domain_Trader _elementOverride(RichIterable val)
{
return _elementOverride(val.getFirst());
}
public Root_meta_external_store_service_tests_domain_Trader _elementOverrideRemove()
{
this._elementOverride = null;
return this;
}
public java.lang.String _kerberos;
public Root_meta_external_store_service_tests_domain_Trader _kerberos(java.lang.String val)
{
this._kerberos = val;
return this;
}
public Root_meta_external_store_service_tests_domain_Trader _kerberos(RichIterable val)
{
return _kerberos(val.getFirst());
}
public Root_meta_external_store_service_tests_domain_Trader _kerberosRemove()
{
this._kerberos = null;
return this;
}
public java.lang.String _kerberos()
{
return this._kerberos;
}
public RichIterable _trades = Lists.mutable.with();
private Root_meta_external_store_service_tests_domain_Trader _trades(org.finos.legend.pure.generated.Root_meta_external_store_service_tests_domain_Trade val, boolean add)
{
if (val == null)
{
if (!add)
{
for (org.finos.legend.pure.generated.Root_meta_external_store_service_tests_domain_Trade v : (RichIterable) this._trades)
{
v._sever_reverse_trader(this);
}
this._trades = Lists.mutable.with();
}
return this;
}
if (add)
{
if (!(this._trades instanceof MutableList))
{
this._trades = this._trades.toList();
}
((MutableList)this._trades).add(val);
}
else
{
for (org.finos.legend.pure.generated.Root_meta_external_store_service_tests_domain_Trade v : (RichIterable) this._trades)
{
v._sever_reverse_trader(this);
}
this._trades = (val == null ? Lists.mutable.empty() : Lists.mutable.with(val));
}
val._reverse_trader(this);
return this;
}
private Root_meta_external_store_service_tests_domain_Trader _trades(RichIterable val, boolean add)
{
if (add)
{
if (!(this._trades instanceof MutableList))
{
this._trades = this._trades.toList();
}
((MutableList)this._trades).addAllIterable(val);
}
else
{
for (org.finos.legend.pure.generated.Root_meta_external_store_service_tests_domain_Trade v : (RichIterable) this._trades)
{
v._sever_reverse_trader(this);
}
this._trades = val;
}
for (org.finos.legend.pure.generated.Root_meta_external_store_service_tests_domain_Trade v : val)
{
v._reverse_trader(this);
}
return this;
}
public Root_meta_external_store_service_tests_domain_Trader _trades(RichIterable val)
{
return this._trades(val, false);
}
public Root_meta_external_store_service_tests_domain_Trader _tradesAdd(org.finos.legend.pure.generated.Root_meta_external_store_service_tests_domain_Trade val)
{
return this._trades(Lists.immutable.with(val), true);
}
public Root_meta_external_store_service_tests_domain_Trader _tradesAddAll(RichIterable val)
{
return this._trades(val, true);
}
public Root_meta_external_store_service_tests_domain_Trader _tradesRemove()
{
this._trades = Lists.mutable.empty();
return this;
}
public Root_meta_external_store_service_tests_domain_Trader _tradesRemove(org.finos.legend.pure.generated.Root_meta_external_store_service_tests_domain_Trade val)
{
if (!(this._trades instanceof MutableList))
{
this._trades = this._trades.toList();
}
((MutableList)this._trades).remove(val);
return this;
}
public void _reverse_trades(org.finos.legend.pure.generated.Root_meta_external_store_service_tests_domain_Trade val)
{
if (!(this._trades instanceof MutableList))
{
this._trades = this._trades.toList();
}
((MutableList)this._trades).add(val);
}
public void _sever_reverse_trades(org.finos.legend.pure.generated.Root_meta_external_store_service_tests_domain_Trade val)
{
if (!(this._trades instanceof MutableList))
{
this._trades = this._trades.toList();
}
((MutableList)this._trades).remove(val);
}
public RichIterable _trades()
{
return this._elementOverride() == null || !GetterOverrideExecutor.class.isInstance(this._elementOverride()) ? this._trades : (RichIterable)((GetterOverrideExecutor)this._elementOverride()).executeToMany(this, "Root::meta::external::store::service::tests::domain::Trader", "trades");
}
public java.lang.String _firstName;
public Root_meta_external_store_service_tests_domain_Trader _firstName(java.lang.String val)
{
this._firstName = val;
return this;
}
public Root_meta_external_store_service_tests_domain_Trader _firstName(RichIterable val)
{
return _firstName(val.getFirst());
}
public Root_meta_external_store_service_tests_domain_Trader _firstNameRemove()
{
this._firstName = null;
return this;
}
public java.lang.String _firstName()
{
return this._firstName;
}
public Root_meta_external_store_service_tests_domain_Trader _classifierGenericType(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.generics.GenericType val)
{
this._classifierGenericType = val;
return this;
}
public Root_meta_external_store_service_tests_domain_Trader _classifierGenericType(RichIterable val)
{
return _classifierGenericType(val.getFirst());
}
public Root_meta_external_store_service_tests_domain_Trader _classifierGenericTypeRemove()
{
this._classifierGenericType = null;
return this;
}
public Root_meta_external_store_service_tests_domain_Trader copy()
{
return new Root_meta_external_store_service_tests_domain_Trader_Impl(this);
}
public Root_meta_external_store_service_tests_domain_Trader_Impl(Root_meta_external_store_service_tests_domain_Trader src)
{
this("Anonymous_NoCounter");
this.classifier = ((Root_meta_external_store_service_tests_domain_Trader_Impl)src).classifier;
this._lastName = (java.lang.String)((Root_meta_external_store_service_tests_domain_Trader_Impl)src)._lastName;
this._elementOverride = (org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.ElementOverride)((Root_meta_external_store_service_tests_domain_Trader_Impl)src)._elementOverride;
this._kerberos = (java.lang.String)((Root_meta_external_store_service_tests_domain_Trader_Impl)src)._kerberos;
this._trades = Lists.mutable.ofAll(((Root_meta_external_store_service_tests_domain_Trader_Impl)src)._trades);
for (org.finos.legend.pure.generated.Root_meta_external_store_service_tests_domain_Trade v : (RichIterable) this._trades)
{
v._reverse_trader(this);
}
this._firstName = (java.lang.String)((Root_meta_external_store_service_tests_domain_Trader_Impl)src)._firstName;
this._classifierGenericType = (org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.generics.GenericType)((Root_meta_external_store_service_tests_domain_Trader_Impl)src)._classifierGenericType;
}
@Override
public String getFullSystemPath()
{
return tempFullTypeId;
}
public Root_meta_external_store_service_tests_domain_Trader_Impl _validate(boolean goDeep, org.finos.legend.pure.m4.coreinstance.SourceInformation sourceInformation, final ExecutionSupport es)
{
if (!this.hasCompileState(CompiledSupport.CONSTRAINTS_VALIDATED))
{
this.addCompileState(CompiledSupport.CONSTRAINTS_VALIDATED);
if (goDeep)
{
for (org.finos.legend.pure.generated.Root_meta_external_store_service_tests_domain_Trade o : this._trades())
{
o._validate(goDeep, sourceInformation, es);
}
}
}
return this;
}
}