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_Trade_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.*;
import org.eclipse.collections.api.block.function.Function0;
import org.eclipse.collections.api.block.function.Function;
import org.eclipse.collections.api.block.function.Function2;
import org.finos.legend.pure.runtime.java.compiled.generation.processors.support.map.PureMap;
public class Root_meta_external_store_service_tests_domain_Trade_Impl extends Root_meta_pure_metamodel_type_Any_Impl implements Root_meta_external_store_service_tests_domain_Trade
{
    public static final String tempTypeName = "Trade";
    private static final String tempFullTypeId = "Root::meta::external::store::service::tests::domain::Trade";
    private static final KeyIndex KEY_INDEX = keyIndexBuilder(7)
           .withKeys(tempFullTypeId, "quantity", "tradeId", "traderKerb")
           .withKeysFromAssociation(tempFullTypeId, "product", "trader")
           .withKeys("Root::meta::pure::metamodel::type::Any", "classifierGenericType", "elementOverride")
           .build();
    private CoreInstance classifier;
    public Root_meta_external_store_service_tests_domain_Trade_Impl(String id)
    {
        super(id);
    }

    public Root_meta_external_store_service_tests_domain_Trade_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 "product":
            {
                return ValCoreInstance.toCoreInstance(_product());
            }
            case "quantity":
            {
                return ValCoreInstance.toCoreInstance(_quantity());
            }
            case "tradeId":
            {
                return ValCoreInstance.toCoreInstance(_tradeId());
            }
            case "trader":
            {
                return ValCoreInstance.toCoreInstance(_trader());
            }
            case "traderKerb":
            {
                return ValCoreInstance.toCoreInstance(_traderKerb());
            }
            default:
            {
                return super.getValueForMetaPropertyToOne(keyName);
            }
        }
    }

    public org.finos.legend.pure.generated.Root_meta_external_store_service_tests_domain_Product _product;
    public Root_meta_external_store_service_tests_domain_Trade _product(org.finos.legend.pure.generated.Root_meta_external_store_service_tests_domain_Product val)
    {
        if (this._product != null) {this._product._sever_reverse_trades(this);}
        this._product = val;
        if (val != null) {val._reverse_trades(this);}
        return this;
    }

    public Root_meta_external_store_service_tests_domain_Trade _product(RichIterable val)
    {
        return _product(val.getFirst());
    }

    public Root_meta_external_store_service_tests_domain_Trade _productRemove()
    {
        this._product = null;
        return this;
    }


    public void _reverse_product(org.finos.legend.pure.generated.Root_meta_external_store_service_tests_domain_Product val)
    {
        this._product = val;
    }

    public void _sever_reverse_product(org.finos.legend.pure.generated.Root_meta_external_store_service_tests_domain_Product val)
    {
        this._product = null;
    }

    public org.finos.legend.pure.generated.Root_meta_external_store_service_tests_domain_Product _product()
    {
        return this._elementOverride() == null || !GetterOverrideExecutor.class.isInstance(this._elementOverride()) ? this._product : (org.finos.legend.pure.generated.Root_meta_external_store_service_tests_domain_Product)((GetterOverrideExecutor)this._elementOverride()).executeToOne(this, "Root::meta::external::store::service::tests::domain::Trade", "product");
    }

    public java.lang.String _traderKerb;
    public Root_meta_external_store_service_tests_domain_Trade _traderKerb(java.lang.String val)
    {
        this._traderKerb = val;
        return this;
    }

    public Root_meta_external_store_service_tests_domain_Trade _traderKerb(RichIterable val)
    {
        return _traderKerb(val.getFirst());
    }

    public Root_meta_external_store_service_tests_domain_Trade _traderKerbRemove()
    {
        this._traderKerb = null;
        return this;
    }


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

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

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


    public java.lang.String _tradeId;
    public Root_meta_external_store_service_tests_domain_Trade _tradeId(java.lang.String val)
    {
        this._tradeId = val;
        return this;
    }

    public Root_meta_external_store_service_tests_domain_Trade _tradeId(RichIterable val)
    {
        return _tradeId(val.getFirst());
    }

    public Root_meta_external_store_service_tests_domain_Trade _tradeIdRemove()
    {
        this._tradeId = null;
        return this;
    }


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

    public long _quantity;
    public Root_meta_external_store_service_tests_domain_Trade _quantity(long val)
    {
        this._quantity = val;
        return this;
    }

    public Root_meta_external_store_service_tests_domain_Trade _quantity(RichIterable val)
    {
        return _quantity(val.getFirst());
    }

    public Root_meta_external_store_service_tests_domain_Trade _quantityRemove()
    {
        this._quantity = 0L;
        return this;
    }


    public long _quantity()
    {
        return this._quantity;
    }

    public org.finos.legend.pure.generated.Root_meta_external_store_service_tests_domain_Trader _trader;
    public Root_meta_external_store_service_tests_domain_Trade _trader(org.finos.legend.pure.generated.Root_meta_external_store_service_tests_domain_Trader val)
    {
        if (this._trader != null) {this._trader._sever_reverse_trades(this);}
        this._trader = val;
        if (val != null) {val._reverse_trades(this);}
        return this;
    }

    public Root_meta_external_store_service_tests_domain_Trade _trader(RichIterable val)
    {
        return _trader(val.getFirst());
    }

    public Root_meta_external_store_service_tests_domain_Trade _traderRemove()
    {
        this._trader = null;
        return this;
    }


    public void _reverse_trader(org.finos.legend.pure.generated.Root_meta_external_store_service_tests_domain_Trader val)
    {
        this._trader = val;
    }

    public void _sever_reverse_trader(org.finos.legend.pure.generated.Root_meta_external_store_service_tests_domain_Trader val)
    {
        this._trader = null;
    }

    public org.finos.legend.pure.generated.Root_meta_external_store_service_tests_domain_Trader _trader()
    {
        return this._elementOverride() == null || !GetterOverrideExecutor.class.isInstance(this._elementOverride()) ? this._trader : (org.finos.legend.pure.generated.Root_meta_external_store_service_tests_domain_Trader)((GetterOverrideExecutor)this._elementOverride()).executeToOne(this, "Root::meta::external::store::service::tests::domain::Trade", "trader");
    }

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

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


    public java.lang.String productName(final ExecutionSupport es)
    {
        return Root_meta_external_store_service_tests_domain_Trade_Impl.this._product()._productName();
    }


    public org.finos.legend.pure.generated.Root_meta_external_store_service_tests_domain_Product justProduct(final ExecutionSupport es)
    {
        return Root_meta_external_store_service_tests_domain_Trade_Impl.this._product();
    }


    public Root_meta_external_store_service_tests_domain_Trade copy()
    {
        return new Root_meta_external_store_service_tests_domain_Trade_Impl(this);
    }
    public Root_meta_external_store_service_tests_domain_Trade_Impl(Root_meta_external_store_service_tests_domain_Trade src)
    {
        this("Anonymous_NoCounter");
        this.classifier = ((Root_meta_external_store_service_tests_domain_Trade_Impl)src).classifier;
        this._product = (org.finos.legend.pure.generated.Root_meta_external_store_service_tests_domain_Product)((Root_meta_external_store_service_tests_domain_Trade_Impl)src)._product;
        if (this._product != null)
        {
            this._product._reverse_trades(this);
        }
        this._traderKerb = (java.lang.String)((Root_meta_external_store_service_tests_domain_Trade_Impl)src)._traderKerb;
        this._elementOverride = (org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.ElementOverride)((Root_meta_external_store_service_tests_domain_Trade_Impl)src)._elementOverride;
        this._tradeId = (java.lang.String)((Root_meta_external_store_service_tests_domain_Trade_Impl)src)._tradeId;
        this._quantity = (java.lang.Long)((Root_meta_external_store_service_tests_domain_Trade_Impl)src)._quantity;
        this._trader = (org.finos.legend.pure.generated.Root_meta_external_store_service_tests_domain_Trader)((Root_meta_external_store_service_tests_domain_Trade_Impl)src)._trader;
        if (this._trader != null)
        {
            this._trader._reverse_trades(this);
        }
        this._classifierGenericType = (org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.generics.GenericType)((Root_meta_external_store_service_tests_domain_Trade_Impl)src)._classifierGenericType;
    }
    @Override
    public String getFullSystemPath()
    {
         return tempFullTypeId;
    }
    public Root_meta_external_store_service_tests_domain_Trade_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)
            {
                if (this._product() != null){this._product()._validate(goDeep, sourceInformation, es);}
                if (this._trader() != null){this._trader()._validate(goDeep, sourceInformation, es);}
            }
        }
        return this;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy