|
| 1 | +/* |
| 2 | + * WARNING: GENERATED FILE - DO NOT EDIT |
| 3 | + * Module: UTP v4.1.00 |
| 4 | +
|
| 5 | + * This file was generated on 2/4/21 5:48 PM by Modelio Studio. |
| 6 | + */ |
| 7 | +package org.modelio.module.utp.api.utpprofile.infrastructure.dependency; |
| 8 | + |
| 9 | +import java.util.ArrayList; |
| 10 | +import java.util.Collections; |
| 11 | +import java.util.Objects; |
| 12 | +import com.modeliosoft.modelio.javadesigner.annotations.objid; |
| 13 | +import org.modelio.api.modelio.model.IModelingSession; |
| 14 | +import org.modelio.api.modelio.model.PropertyConverter; |
| 15 | +import org.modelio.api.module.context.IModuleContext; |
| 16 | +import org.modelio.metamodel.mmextensions.infrastructure.ExtensionNotFoundException; |
| 17 | +import org.modelio.metamodel.uml.infrastructure.Dependency; |
| 18 | +import org.modelio.metamodel.uml.infrastructure.ModelElement; |
| 19 | +import org.modelio.metamodel.uml.infrastructure.Stereotype; |
| 20 | +import org.modelio.metamodel.uml.infrastructure.TagType; |
| 21 | +import org.modelio.metamodel.uml.infrastructure.properties.PropertyDefinition; |
| 22 | +import org.modelio.metamodel.uml.infrastructure.properties.PropertyTableDefinition; |
| 23 | +import org.modelio.module.utp.api.IUTPPeerModule; |
| 24 | +import org.modelio.module.utp.api.UTPProxyFactory; |
| 25 | +import org.modelio.module.utp.impl.UTPModule; |
| 26 | +import org.modelio.vcore.smkernel.mapi.MObject; |
| 27 | + |
| 28 | +/** |
| 29 | + * Proxy class to handle a {@link Dependency} with << DefaultApplication >> stereotype. |
| 30 | + * <p>Stereotype description: |
| 31 | + * <br/><i></i></p> |
| 32 | + */ |
| 33 | +@objid ("1ec3b54d-4fce-448e-a90f-ab7b3d72df11") |
| 34 | +public class DefaultApplication { |
| 35 | + @objid ("3f58faf6-68e8-4ff3-8545-f7e62c91c388") |
| 36 | + public static final String STEREOTYPE_NAME = "DefaultApplication"; |
| 37 | + |
| 38 | + /** |
| 39 | + * The underlying {@link Dependency} represented by this proxy, never null. |
| 40 | + */ |
| 41 | + @objid ("c94174db-2b1c-4066-a32c-0fda60d6cfd7") |
| 42 | + protected final Dependency elt; |
| 43 | + |
| 44 | + /** |
| 45 | + * Tells whether a {@link DefaultApplication proxy} can be instantiated from a {@link MObject} checking it is a {@link Dependency} stereotyped << DefaultApplication >>. |
| 46 | + * <p> |
| 47 | + * The method returns <code>false</code> if the instantiation cannot be carried out. |
| 48 | + * |
| 49 | + * @param elt a model object |
| 50 | + * @return <code>true</code> if the instantiation can be carried out else <code>false</code>. |
| 51 | + */ |
| 52 | + @objid ("79fec4f0-6ab7-4b43-a594-5b1be6b010fb") |
| 53 | + public static boolean canInstantiate(final MObject elt) { |
| 54 | + return ((elt instanceof Dependency) && ((Dependency) elt).isStereotyped(IUTPPeerModule.MODULE_NAME, DefaultApplication.STEREOTYPE_NAME)); |
| 55 | + } |
| 56 | + |
| 57 | + /** |
| 58 | + * Create a new {@link Dependency} stereotyped << DefaultApplication >> then instantiate a {@link DefaultApplication} proxy. |
| 59 | + * |
| 60 | + * @return a {@link DefaultApplication} proxy on the created {@link Dependency}. |
| 61 | + */ |
| 62 | + @objid ("e8fa7ac7-ceba-4cc5-a00b-10b3b9ea51f7") |
| 63 | + public static DefaultApplication create() { |
| 64 | + ModelElement e = (ModelElement)UTPModule.getInstance().getModuleContext().getModelingSession().getModel().createElement("Infrastructure.Dependency"); |
| 65 | + e.addStereotype(IUTPPeerModule.MODULE_NAME, DefaultApplication.STEREOTYPE_NAME); |
| 66 | + return DefaultApplication.instantiate((Dependency)e); |
| 67 | + } |
| 68 | + |
| 69 | + /** |
| 70 | + * Tries to instantiate a {@link DefaultApplication} proxy from a {@link Dependency} stereotyped << DefaultApplication >> checking its metaclass and its stereotype. |
| 71 | + * <p> |
| 72 | + * The method returns <i>null</i> if the instantiation cannot be carried out. |
| 73 | + * @param obj a Dependency |
| 74 | + * @return a {@link DefaultApplication} proxy or <i>null</i>. |
| 75 | + */ |
| 76 | + @objid ("8d977560-cb96-4389-99ed-6b34dd52af79") |
| 77 | + public static DefaultApplication instantiate(final Dependency obj) { |
| 78 | + return DefaultApplication.canInstantiate(obj) ? new DefaultApplication(obj) : null; |
| 79 | + } |
| 80 | + |
| 81 | + /** |
| 82 | + * Tries to instantiate a {@link DefaultApplication} proxy from a {@link Dependency} stereotyped << DefaultApplication >> checking its metaclass and its stereotype. |
| 83 | + * <p> |
| 84 | + * The method throws an {@link IllegalArgumentException} if the instantiation cannot be carried out. |
| 85 | + * @param obj a {@link Dependency} |
| 86 | + * @return a {@link DefaultApplication} proxy. |
| 87 | + * @throws IllegalArgumentException if the instantiation cannot be carried out. |
| 88 | + */ |
| 89 | + @objid ("e9393f15-8302-413e-9285-be06efa4beff") |
| 90 | + public static DefaultApplication safeInstantiate(final Dependency obj) throws IllegalArgumentException { |
| 91 | + if (DefaultApplication.canInstantiate(obj)) |
| 92 | + return new DefaultApplication(obj); |
| 93 | + else |
| 94 | + throw new IllegalArgumentException("DefaultApplication: Cannot instantiate "+obj+": wrong element type or stereotype"); |
| 95 | + } |
| 96 | + |
| 97 | + @objid ("71c8aa8b-dd5d-4d44-a288-3b0e34c89257") |
| 98 | + @Override |
| 99 | + public boolean equals(final Object obj) { |
| 100 | + if (this == obj) { |
| 101 | + return true; |
| 102 | + } |
| 103 | + if (obj == null) { |
| 104 | + return false; |
| 105 | + } |
| 106 | + if (getClass() != obj.getClass()) { |
| 107 | + return false; |
| 108 | + } |
| 109 | + DefaultApplication other = (DefaultApplication) obj; |
| 110 | + return java.util.Objects.equals(getElement(), other.getElement()); |
| 111 | + } |
| 112 | + |
| 113 | + /** |
| 114 | + * Get the underlying {@link Dependency}. |
| 115 | + * @return the Dependency represented by this proxy, never null. |
| 116 | + */ |
| 117 | + @objid ("24bc7b57-7a8a-485b-9a41-8716dbca9871") |
| 118 | + public Dependency getElement() { |
| 119 | + return this.elt; |
| 120 | + } |
| 121 | + |
| 122 | + @objid ("4b57e5bb-e03b-4853-8c35-9b2d12c24569") |
| 123 | + @Override |
| 124 | + public int hashCode() { |
| 125 | + return 23 + ((this.elt == null) ? 0 : this.elt.hashCode()); |
| 126 | + } |
| 127 | + |
| 128 | + @objid ("78ba2795-c070-4515-a71a-e11b5bf5c6a3") |
| 129 | + protected DefaultApplication(final Dependency elt) { |
| 130 | + this.elt = elt; |
| 131 | + } |
| 132 | + |
| 133 | + @objid ("4a25a654-403f-4d59-b27a-1ac366f18c07") |
| 134 | + public static final class MdaTypes { |
| 135 | + @objid ("2bc1a358-59ea-40b3-8bba-31b8c2ac98fb") |
| 136 | + public static Stereotype STEREOTYPE_ELT; |
| 137 | + |
| 138 | + @objid ("1f3f5438-aa5d-43cb-a9ab-a3471830ce05") |
| 139 | + private static Stereotype MDAASSOCDEP; |
| 140 | + |
| 141 | + @objid ("16aa7b83-d24c-47a6-9580-4380d5450404") |
| 142 | + private static TagType MDAASSOCDEP_ROLE; |
| 143 | + |
| 144 | + @objid ("83b5e660-1ba6-45ca-9d29-1cbd52290d71") |
| 145 | + public static void init(final IModuleContext ctx) { |
| 146 | + STEREOTYPE_ELT = ctx.getModelingSession().findElementById(Stereotype.class, "50726a80-e339-11df-9694-0027103ea5f4"); |
| 147 | + MDAASSOCDEP = ctx.getModelingSession().findElementById(Stereotype.class, "94b7efa5-f94c-4d1d-896f-f103e56a8e2e"); |
| 148 | + MDAASSOCDEP_ROLE = ctx.getModelingSession().findElementById(TagType.class, "7637f2fd-b750-43c1-a15c-5d0b084ca1cd"); |
| 149 | + } |
| 150 | + |
| 151 | + |
| 152 | + static { |
| 153 | + if(UTPModule.getInstance() != null) { |
| 154 | + init(UTPModule.getInstance().getModuleContext()); |
| 155 | + } |
| 156 | + } |
| 157 | + } |
| 158 | + |
| 159 | +} |
0 commit comments