All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.finos.legend.pure.generated.Root_meta_external_store_service_tests_domain_S_Product_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_S_Product_Impl extends Root_meta_pure_metamodel_type_Any_Impl implements Root_meta_external_store_service_tests_domain_S_Product
{
    public static final String tempTypeName = "S_Product";
    private static final String tempFullTypeId = "Root::meta::external::store::service::tests::domain::S_Product";
    private static final KeyIndex KEY_INDEX = keyIndexBuilder(8)
           .withKeys(tempFullTypeId, "s_description", "s_productId", "s_productName", "s_synonyms", "s_tradeId")
           .withKeyFromAssociation(tempFullTypeId, "s_trades")
           .withKeys("Root::meta::pure::metamodel::type::Any", "classifierGenericType", "elementOverride")
           .build();
    private CoreInstance classifier;
    public Root_meta_external_store_service_tests_domain_S_Product_Impl(String id)
    {
        super(id);
    }

    public Root_meta_external_store_service_tests_domain_S_Product_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 "s_description":
            {
                return ValCoreInstance.toCoreInstance(_s_description());
            }
            case "s_productId":
            {
                return ValCoreInstance.toCoreInstance(_s_productId());
            }
            case "s_productName":
            {
                return ValCoreInstance.toCoreInstance(_s_productName());
            }
            case "s_tradeId":
            {
                return ValCoreInstance.toCoreInstance(_s_tradeId());
            }
            default:
            {
                return super.getValueForMetaPropertyToOne(keyName);
            }
        }
    }

    @Override
    public ListIterable getValueForMetaPropertyToMany(String keyName)
    {
        switch (keyName)
        {
            case "s_synonyms":
            {
                return ValCoreInstance.toCoreInstances(_s_synonyms());
            }
            case "s_trades":
            {
                return ValCoreInstance.toCoreInstances(_s_trades());
            }
            default:
            {
                return super.getValueForMetaPropertyToMany(keyName);
            }
        }
    }

    public java.lang.String _s_productId;
    public Root_meta_external_store_service_tests_domain_S_Product _s_productId(java.lang.String val)
    {
        this._s_productId = val;
        return this;
    }

    public Root_meta_external_store_service_tests_domain_S_Product _s_productId(RichIterable val)
    {
        return _s_productId(val.getFirst());
    }

    public Root_meta_external_store_service_tests_domain_S_Product _s_productIdRemove()
    {
        this._s_productId = null;
        return this;
    }


    public java.lang.String _s_productId()
    {
        return this._s_productId;
    }

    public java.lang.String _s_productName;
    public Root_meta_external_store_service_tests_domain_S_Product _s_productName(java.lang.String val)
    {
        this._s_productName = val;
        return this;
    }

    public Root_meta_external_store_service_tests_domain_S_Product _s_productName(RichIterable val)
    {
        return _s_productName(val.getFirst());
    }

    public Root_meta_external_store_service_tests_domain_S_Product _s_productNameRemove()
    {
        this._s_productName = null;
        return this;
    }


    public java.lang.String _s_productName()
    {
        return this._s_productName;
    }

    public Root_meta_external_store_service_tests_domain_S_Product _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_S_Product _elementOverride(RichIterable val)
    {
        return _elementOverride(val.getFirst());
    }

    public Root_meta_external_store_service_tests_domain_S_Product _elementOverrideRemove()
    {
        this._elementOverride = null;
        return this;
    }


    public java.lang.String _s_tradeId;
    public Root_meta_external_store_service_tests_domain_S_Product _s_tradeId(java.lang.String val)
    {
        this._s_tradeId = val;
        return this;
    }

    public Root_meta_external_store_service_tests_domain_S_Product _s_tradeId(RichIterable val)
    {
        return _s_tradeId(val.getFirst());
    }

    public Root_meta_external_store_service_tests_domain_S_Product _s_tradeIdRemove()
    {
        this._s_tradeId = null;
        return this;
    }


    public java.lang.String _s_tradeId()
    {
        return this._s_tradeId;
    }

    public java.lang.String _s_description;
    public Root_meta_external_store_service_tests_domain_S_Product _s_description(java.lang.String val)
    {
        this._s_description = val;
        return this;
    }

    public Root_meta_external_store_service_tests_domain_S_Product _s_description(RichIterable val)
    {
        return _s_description(val.getFirst());
    }

    public Root_meta_external_store_service_tests_domain_S_Product _s_descriptionRemove()
    {
        this._s_description = null;
        return this;
    }


    public java.lang.String _s_description()
    {
        return this._s_description;
    }

    public RichIterable _s_trades = Lists.mutable.with();
    private Root_meta_external_store_service_tests_domain_S_Product _s_trades(org.finos.legend.pure.generated.Root_meta_external_store_service_tests_domain_S_Trade val, boolean add)
    {
        if (val == null)
        {
            if (!add)
            {
                for (org.finos.legend.pure.generated.Root_meta_external_store_service_tests_domain_S_Trade v : (RichIterable) this._s_trades)
                {
                    v._sever_reverse_s_product(this);
                }
                this._s_trades = Lists.mutable.with();
            }
            return this;
        }
        if (add)
        {
            if (!(this._s_trades instanceof MutableList))
            {
                this._s_trades = this._s_trades.toList();
            }
            ((MutableList)this._s_trades).add(val);
        }
        else
        {
            for (org.finos.legend.pure.generated.Root_meta_external_store_service_tests_domain_S_Trade v : (RichIterable) this._s_trades)
            {
                v._sever_reverse_s_product(this);
            }
            this._s_trades = (val == null ? Lists.mutable.empty() : Lists.mutable.with(val));
        }
        val._reverse_s_product(this);
        return this;
    }

    private Root_meta_external_store_service_tests_domain_S_Product _s_trades(RichIterable val, boolean add)
    {
        if (add)
        {
            if (!(this._s_trades instanceof MutableList))
            {
                this._s_trades = this._s_trades.toList();
            }
            ((MutableList)this._s_trades).addAllIterable(val);
        }
        else
        {
            for (org.finos.legend.pure.generated.Root_meta_external_store_service_tests_domain_S_Trade v : (RichIterable) this._s_trades)
            {
                v._sever_reverse_s_product(this);
            }
            this._s_trades = val;
        }
        for (org.finos.legend.pure.generated.Root_meta_external_store_service_tests_domain_S_Trade v : val)
        {
            v._reverse_s_product(this);
        }
        return this;
    }

    public Root_meta_external_store_service_tests_domain_S_Product _s_trades(RichIterable val)
    {
        return this._s_trades(val, false);
    }

    public Root_meta_external_store_service_tests_domain_S_Product _s_tradesAdd(org.finos.legend.pure.generated.Root_meta_external_store_service_tests_domain_S_Trade val)
    {
        return this._s_trades(Lists.immutable.with(val), true);
    }

    public Root_meta_external_store_service_tests_domain_S_Product _s_tradesAddAll(RichIterable val)
    {
        return this._s_trades(val, true);
    }

    public Root_meta_external_store_service_tests_domain_S_Product _s_tradesRemove()
    {
        this._s_trades = Lists.mutable.empty();
        return this;
    }

    public Root_meta_external_store_service_tests_domain_S_Product _s_tradesRemove(org.finos.legend.pure.generated.Root_meta_external_store_service_tests_domain_S_Trade val)
    {
        if (!(this._s_trades instanceof MutableList))
        {
            this._s_trades = this._s_trades.toList();
        }
        ((MutableList)this._s_trades).remove(val);
        return this;
    }


    public void _reverse_s_trades(org.finos.legend.pure.generated.Root_meta_external_store_service_tests_domain_S_Trade val)
    {
        if (!(this._s_trades instanceof MutableList))
        {
            this._s_trades = this._s_trades.toList();
        }
        ((MutableList)this._s_trades).add(val);
    }

    public void _sever_reverse_s_trades(org.finos.legend.pure.generated.Root_meta_external_store_service_tests_domain_S_Trade val)
    {
        if (!(this._s_trades instanceof MutableList))
        {
            this._s_trades = this._s_trades.toList();
        }
        ((MutableList)this._s_trades).remove(val);
    }

    public RichIterable _s_trades()
    {
        return this._elementOverride() == null || !GetterOverrideExecutor.class.isInstance(this._elementOverride()) ? this._s_trades : (RichIterable)((GetterOverrideExecutor)this._elementOverride()).executeToMany(this, "Root::meta::external::store::service::tests::domain::S_Product", "s_trades");
    }

    public Root_meta_external_store_service_tests_domain_S_Product _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_S_Product _classifierGenericType(RichIterable val)
    {
        return _classifierGenericType(val.getFirst());
    }

    public Root_meta_external_store_service_tests_domain_S_Product _classifierGenericTypeRemove()
    {
        this._classifierGenericType = null;
        return this;
    }


    public RichIterable _s_synonyms = Lists.mutable.with();
    private Root_meta_external_store_service_tests_domain_S_Product _s_synonyms(org.finos.legend.pure.generated.Root_meta_external_store_service_tests_domain_S_Synonym val, boolean add)
    {
        if (val == null)
        {
            if (!add)
            {
                this._s_synonyms = Lists.mutable.with();
            }
            return this;
        }
        if (add)
        {
            if (!(this._s_synonyms instanceof MutableList))
            {
                this._s_synonyms = this._s_synonyms.toList();
            }
            ((MutableList)this._s_synonyms).add(val);
        }
        else
        {
            this._s_synonyms = (val == null ? Lists.mutable.empty() : Lists.mutable.with(val));
        }
        return this;
    }

    private Root_meta_external_store_service_tests_domain_S_Product _s_synonyms(RichIterable val, boolean add)
    {
        if (add)
        {
            if (!(this._s_synonyms instanceof MutableList))
            {
                this._s_synonyms = this._s_synonyms.toList();
            }
            ((MutableList)this._s_synonyms).addAllIterable(val);
        }
        else
        {
            this._s_synonyms = val;
        }
        return this;
    }

    public Root_meta_external_store_service_tests_domain_S_Product _s_synonyms(RichIterable val)
    {
        return this._s_synonyms(val, false);
    }

    public Root_meta_external_store_service_tests_domain_S_Product _s_synonymsAdd(org.finos.legend.pure.generated.Root_meta_external_store_service_tests_domain_S_Synonym val)
    {
        return this._s_synonyms(Lists.immutable.with(val), true);
    }

    public Root_meta_external_store_service_tests_domain_S_Product _s_synonymsAddAll(RichIterable val)
    {
        return this._s_synonyms(val, true);
    }

    public Root_meta_external_store_service_tests_domain_S_Product _s_synonymsRemove()
    {
        this._s_synonyms = Lists.mutable.empty();
        return this;
    }

    public Root_meta_external_store_service_tests_domain_S_Product _s_synonymsRemove(org.finos.legend.pure.generated.Root_meta_external_store_service_tests_domain_S_Synonym val)
    {
        if (!(this._s_synonyms instanceof MutableList))
        {
            this._s_synonyms = this._s_synonyms.toList();
        }
        ((MutableList)this._s_synonyms).remove(val);
        return this;
    }


    public void _reverse_s_synonyms(org.finos.legend.pure.generated.Root_meta_external_store_service_tests_domain_S_Synonym val)
    {
        if (!(this._s_synonyms instanceof MutableList))
        {
            this._s_synonyms = this._s_synonyms.toList();
        }
        ((MutableList)this._s_synonyms).add(val);
    }

    public void _sever_reverse_s_synonyms(org.finos.legend.pure.generated.Root_meta_external_store_service_tests_domain_S_Synonym val)
    {
        if (!(this._s_synonyms instanceof MutableList))
        {
            this._s_synonyms = this._s_synonyms.toList();
        }
        ((MutableList)this._s_synonyms).remove(val);
    }

    public RichIterable _s_synonyms()
    {
        return this._elementOverride() == null || !GetterOverrideExecutor.class.isInstance(this._elementOverride()) ? this._s_synonyms : (RichIterable)((GetterOverrideExecutor)this._elementOverride()).executeToMany(this, "Root::meta::external::store::service::tests::domain::S_Product", "s_synonyms");
    }

    
    public Root_meta_external_store_service_tests_domain_S_Product copy()
    {
        return new Root_meta_external_store_service_tests_domain_S_Product_Impl(this);
    }
    public Root_meta_external_store_service_tests_domain_S_Product_Impl(Root_meta_external_store_service_tests_domain_S_Product src)
    {
        this("Anonymous_NoCounter");
        this.classifier = ((Root_meta_external_store_service_tests_domain_S_Product_Impl)src).classifier;
        this._s_productId = (java.lang.String)((Root_meta_external_store_service_tests_domain_S_Product_Impl)src)._s_productId;
        this._s_productName = (java.lang.String)((Root_meta_external_store_service_tests_domain_S_Product_Impl)src)._s_productName;
        this._elementOverride = (org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.ElementOverride)((Root_meta_external_store_service_tests_domain_S_Product_Impl)src)._elementOverride;
        this._s_tradeId = (java.lang.String)((Root_meta_external_store_service_tests_domain_S_Product_Impl)src)._s_tradeId;
        this._s_description = (java.lang.String)((Root_meta_external_store_service_tests_domain_S_Product_Impl)src)._s_description;
        this._s_trades = Lists.mutable.ofAll(((Root_meta_external_store_service_tests_domain_S_Product_Impl)src)._s_trades);
        for (org.finos.legend.pure.generated.Root_meta_external_store_service_tests_domain_S_Trade v : (RichIterable) this._s_trades)
        {
            v._reverse_s_product(this);
        }
        this._classifierGenericType = (org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.generics.GenericType)((Root_meta_external_store_service_tests_domain_S_Product_Impl)src)._classifierGenericType;
        this._s_synonyms = Lists.mutable.ofAll(((Root_meta_external_store_service_tests_domain_S_Product_Impl)src)._s_synonyms);
    }
    @Override
    public String getFullSystemPath()
    {
         return tempFullTypeId;
    }
    public Root_meta_external_store_service_tests_domain_S_Product_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_S_Trade o : this._s_trades())
                {
                    o._validate(goDeep, sourceInformation, es);
                }
                for (org.finos.legend.pure.generated.Root_meta_external_store_service_tests_domain_S_Synonym o : this._s_synonyms())
                {
                    o._validate(goDeep, sourceInformation, es);
                }
            }
        }
        return this;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy