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

org.umlg.redefinition.Account Maven / Gradle / Ivy

The newest version!
package org.umlg.redefinition;

import com.fasterxml.jackson.databind.ObjectMapper;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.UUID;

import org.apache.commons.text.StringEscapeUtils;
import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.umlg.redefinition.LegalEntity.LegalEntityRuntimePropertyEnum;
import org.umlg.runtime.adaptor.TransactionThreadEntityVar;
import org.umlg.runtime.adaptor.UMLG;
import org.umlg.runtime.adaptor.UmlgLabelConverterFactory;
import org.umlg.runtime.adaptor.UmlgTmpIdManager;
import org.umlg.runtime.collection.Filter;
import org.umlg.runtime.collection.Qualifier;
import org.umlg.runtime.collection.UmlgCollection;
import org.umlg.runtime.collection.UmlgRuntimeProperty;
import org.umlg.runtime.collection.UmlgSet;
import org.umlg.runtime.collection.memory.UmlgMemorySet;
import org.umlg.runtime.collection.persistent.PropertyTree;
import org.umlg.runtime.collection.persistent.UmlgSetImpl;
import org.umlg.runtime.domain.BaseUmlgCompositionNode;
import org.umlg.runtime.domain.CompositionNode;
import org.umlg.runtime.domain.DataTypeEnum;
import org.umlg.runtime.domain.UmlgNode;
import org.umlg.runtime.util.ObjectMapperFactory;
import org.umlg.runtime.util.UmlgFormatter;
import org.umlg.runtime.validation.UmlgConstraintViolation;
import org.umlg.runtime.validation.UmlgConstraintViolationException;
import org.umlg.runtime.validation.UmlgValidation;

public class Account extends BaseUmlgCompositionNode implements CompositionNode {
	static final public long serialVersionUID = 1L;
	private UmlgSet minimum;
	private UmlgSet priority;
	private UmlgSet balance;
	private UmlgSet owner;
	private UmlgSet agent;
	private String tmpId;	// tmpId is only used the umlg restlet gui. It is never persisted. Its value is generated by the gui.

	/**
	 * constructor for Account
	 * 
	 * @param id 
	 */
	public Account(Object id)  {
		super(id);
	}
	
	/**
	 * constructor for Account
	 * 
	 * @param vertex 
	 */
	public Account(Vertex vertex)  {
		super(vertex);
	}
	
	/**
	 * default constructor for Account
	 */
	public Account()  {
		this(true);
	}
	
	/**
	 * constructor for Account
	 * 
	 * @param persistent 
	 */
	public Account(Boolean persistent)  {
		super(persistent);
	}

	public void addToAgent(LegalEntity agent) {
		if ( agent != null ) {
			agent.clearAccountAgent();
			agent.initialiseProperty(LegalEntityRuntimePropertyEnum.accountAgent, false, true);
			removeFromAgent(agent);
		}
		if ( agent != null ) {
			this.agent.add(agent);
		}
	}
	
	public void addToAgent(UmlgSet agent) {
		if ( !agent.isEmpty() ) {
			this.agent.addAll(agent);
		}
	}
	
	public void addToAgentIgnoreInverse(LegalEntity agent) {
		if ( agent != null ) {
			agent.clearAccountAgent();
			agent.initialiseProperty(LegalEntityRuntimePropertyEnum.accountAgent, false, true);
			removeFromAgent(agent);
		}
		if ( agent != null ) {
			this.agent.addIgnoreInverse(agent);
		}
	}
	
	public void addToBalance(Double balance) {
		if ( !this.balance.isEmpty() ) {
			throw new RuntimeException("Property is a one and already has value, first clear it before adding!");
		}
		if ( balance != null ) {
			List violations = validateBalance(balance);
			if ( violations.isEmpty() ) {
				this.balance.add(balance);
			} else {
				throw new UmlgConstraintViolationException(violations);
			}
		}
	}
	
	public void addToBalanceIgnoreInverse(Double balance) {
		if ( !this.balance.isEmpty() ) {
			throw new RuntimeException("Property is a one and already has value, first clear it before adding!");
		}
		if ( balance != null ) {
			List violations = validateBalance(balance);
			if ( violations.isEmpty() ) {
				this.balance.add(balance);
			} else {
				throw new UmlgConstraintViolationException(violations);
			}
		}
	}
	
	public void addToMinimum(Double minimum) {
		if ( !this.minimum.isEmpty() ) {
			throw new RuntimeException("Property is a one and already has value, first clear it before adding!");
		}
		if ( minimum != null ) {
			List violations = validateMinimum(minimum);
			if ( violations.isEmpty() ) {
				this.minimum.add(minimum);
			} else {
				throw new UmlgConstraintViolationException(violations);
			}
		}
	}
	
	public void addToMinimumIgnoreInverse(Double minimum) {
		if ( !this.minimum.isEmpty() ) {
			throw new RuntimeException("Property is a one and already has value, first clear it before adding!");
		}
		if ( minimum != null ) {
			List violations = validateMinimum(minimum);
			if ( violations.isEmpty() ) {
				this.minimum.add(minimum);
			} else {
				throw new UmlgConstraintViolationException(violations);
			}
		}
	}
	
	public void addToOwner(LegalEntity owner) {
		if ( owner != null ) {
			owner.clearAccountOwner();
			owner.initialiseProperty(LegalEntityRuntimePropertyEnum.accountOwner, false, true);
			removeFromOwner(owner);
		}
		if ( owner != null ) {
			this.owner.add(owner);
		}
	}
	
	public void addToOwner(UmlgSet owner) {
		if ( !owner.isEmpty() ) {
			this.owner.addAll(owner);
		}
	}
	
	public void addToOwnerIgnoreInverse(LegalEntity owner) {
		if ( owner != null ) {
			owner.clearAccountOwner();
			owner.initialiseProperty(LegalEntityRuntimePropertyEnum.accountOwner, false, true);
			removeFromOwner(owner);
		}
		if ( owner != null ) {
			this.owner.addIgnoreInverse(owner);
		}
	}
	
	public void addToPriority(Integer priority) {
		if ( !this.priority.isEmpty() ) {
			throw new RuntimeException("Property is a one and already has value, first clear it before adding!");
		}
		if ( priority != null ) {
			List violations = validatePriority(priority);
			if ( violations.isEmpty() ) {
				this.priority.add(priority);
			} else {
				throw new UmlgConstraintViolationException(violations);
			}
		}
	}
	
	public void addToPriorityIgnoreInverse(Integer priority) {
		if ( !this.priority.isEmpty() ) {
			throw new RuntimeException("Property is a one and already has value, first clear it before adding!");
		}
		if ( priority != null ) {
			List violations = validatePriority(priority);
			if ( violations.isEmpty() ) {
				this.priority.add(priority);
			} else {
				throw new UmlgConstraintViolationException(violations);
			}
		}
	}
	
	static public UmlgSet allInstances(Filter filter) {
		UmlgSet result = new UmlgMemorySet();
		result.addAll(UMLG.get().allInstances(Account.class.getName(), filter));
		result.addAll(UMLG.get().allInstances(CorporateAccount.class.getName(), filter));
		result.addAll(UMLG.get().allInstances(PersonalAccount.class.getName(), filter));
		return result;
	}
	
	static public UmlgSet allInstances() {
		UmlgSet result = new UmlgMemorySet();
		result.addAll(UMLG.get().allInstances(Account.class.getName()));
		result.addAll(UMLG.get().allInstances(CorporateAccount.class.getName()));
		result.addAll(UMLG.get().allInstances(PersonalAccount.class.getName()));
		return result;
	}
	
	@Override
	public List checkClassConstraints() {
		List result = new ArrayList();
		return result;
	}
	
	public void clearAgent() {
		this.agent.clear();
	}
	
	public void clearBalance() {
		this.balance.clear();
	}
	
	public void clearMinimum() {
		this.minimum.clear();
	}
	
	public void clearOwner() {
		this.owner.clear();
	}
	
	public void clearPriority() {
		this.priority.clear();
	}
	
	@Override
	public void delete() {
		this.owner.clear();
		this.agent.clear();
		TransactionThreadEntityVar.remove(this);
		this.vertex.remove();
	}
	
	@Override
	public void fromJson(Map propertyMap) {
		fromJsonDataTypeAndComposite(propertyMap);
		fromJsonNonCompositeOne(propertyMap);
		fromJsonNonCompositeRequiredMany(propertyMap);
	}
	
	@Override
	public void fromJson(String json) {
		ObjectMapper mapper = ObjectMapperFactory.INSTANCE.getObjectMapper();
		try {
			@SuppressWarnings(	"unchecked")
			 Map propertyMap = mapper.readValue(json, Map.class);
			fromJson(propertyMap);
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}
	
	@Override
	public void fromJsonDataTypeAndComposite(Map propertyMap) {
		Number balanceAsNumber = (Number)propertyMap.get("balance");
		Number priorityAsNumber = (Number)propertyMap.get("priority");
		Number minimumAsNumber = (Number)propertyMap.get("minimum");
		if ( propertyMap.containsKey("balance") ) {
			if ( propertyMap.get("balance") != null ) {
				Double balance = balanceAsNumber != null ? balanceAsNumber.doubleValue() : null;
				setBalance(balance);
			} else {
				setBalance(null);
			}
		}
		if ( propertyMap.containsKey("priority") ) {
			if ( propertyMap.get("priority") != null ) {
				Integer priority = priorityAsNumber != null ? priorityAsNumber.intValue() : null;
				setPriority(priority);
			} else {
				setPriority(null);
			}
		}
		if ( propertyMap.containsKey("minimum") ) {
			if ( propertyMap.get("minimum") != null ) {
				Double minimum = minimumAsNumber != null ? minimumAsNumber.doubleValue() : null;
				setMinimum(minimum);
			} else {
				setMinimum(null);
			}
		}
		if ( propertyMap.containsKey("tmpId") ) {
			if ( propertyMap.get("tmpId") != null ) {
				this.tmpId = (String)propertyMap.get("tmpId");
				UmlgTmpIdManager.INSTANCE.put(this.tmpId, getId());
			} else {
				this.tmpId = null;
			}
		}
	}
	
	@Override
	public void fromJsonNonCompositeOne(Map propertyMap) {
	}
	
	@Override
	public void fromJsonNonCompositeRequiredMany(Map propertyMap) {
		if ( propertyMap.containsKey("owner") ) {
			if ( propertyMap.get("owner") != null ) {
				List> ownerMap = (ArrayList>)propertyMap.get("owner");
				clearOwner();
				for ( Map row : ownerMap ) {
					LegalEntity owner = UMLG.get().getEntity(row.get("id"));
					addToOwner(owner);
				}
			}
		}
	}
	
	public UmlgSet getAgent() {
		return this.agent;
	}
	
	public Double getBalance() {
		UmlgSet tmp = this.balance;
		if ( !tmp.isEmpty() ) {
			return tmp.iterator().next();
		} else {
			return null;
		}
	}
	
	@Override
	public String getMetaDataAsJson() {
		return Account.AccountRuntimePropertyEnum.asJson();
	}
	
	public Double getMinimum() {
		UmlgSet tmp = this.minimum;
		if ( !tmp.isEmpty() ) {
			return tmp.iterator().next();
		} else {
			return null;
		}
	}
	
	public UmlgSet getOwner() {
		return this.owner;
	}
	
	@Override
	public UmlgNode getOwningObject() {
		return null;
	}
	
	public Integer getPriority() {
		UmlgSet tmp = this.priority;
		if ( !tmp.isEmpty() ) {
			return tmp.iterator().next();
		} else {
			return null;
		}
	}
	
	@Override
	public String getQualifiedName() {
		return "umlgtest::org::umlg::redefinition::Account";
	}
	
	/**
	 * getQualifiers is called from the collection in order to update the index used to implement the qualifier
	 * 
	 * @param tumlRuntimeProperty 
	 * @param node 
	 * @param inverse 
	 */
	@Override
	public List getQualifiers(UmlgRuntimeProperty tumlRuntimeProperty, UmlgNode node, boolean inverse) {
		List result = Collections.emptyList();
		AccountRuntimePropertyEnum runtimeProperty;
		if ( !inverse ) {
			runtimeProperty = AccountRuntimePropertyEnum.fromQualifiedName(tumlRuntimeProperty.getQualifiedName());
		} else {
			runtimeProperty = AccountRuntimePropertyEnum.fromQualifiedName(tumlRuntimeProperty.getInverseQualifiedName());
		}
		if ( runtimeProperty != null && result.isEmpty() ) {
			switch ( runtimeProperty ) {
				default:
					result = Collections.emptyList();
			}
		
		}
		return result;
	}
	
	/**
	 * getSize is called from the BaseCollection.addInternal in order to save the size of the inverse collection to update the edge's sequence order
	 * 
	 * @param inverse 
	 * @param tumlRuntimeProperty 
	 */
	@Override
	public int getSize(boolean inverse, UmlgRuntimeProperty tumlRuntimeProperty) {
		int result = 0;
		AccountRuntimePropertyEnum runtimeProperty;
		if ( !inverse ) {
			runtimeProperty = AccountRuntimePropertyEnum.fromQualifiedName(tumlRuntimeProperty.getQualifiedName());
		} else {
			runtimeProperty = AccountRuntimePropertyEnum.fromQualifiedName(tumlRuntimeProperty.getInverseQualifiedName());
		}
		if ( runtimeProperty != null && result == 0 ) {
			switch ( runtimeProperty ) {
				case balance:
					result = balance.size();
					break;
			
				case priority:
					result = priority.size();
					break;
			
				case owner:
					result = owner.size();
					break;
			
				case minimum:
					result = minimum.size();
					break;
			
				case agent:
					result = agent.size();
					break;
			
				default:
					result = 0;
			}
		
		}
		return result;
	}
	
	@Override
	public String getUid() {
		String uid;
		if ( !this.vertex.property("uid").isPresent() && this.vertex.property("uid").value() != null ) {
			uid=UUID.randomUUID().toString();
			this.vertex.property("uid", uid);
		} else {
			uid=this.vertex.value("uid");
		}
		return uid;
	}
	
	@Override
	public boolean hasOnlyOneCompositeParent() {
		int result = 0;
		return result == 1;
	}
	
	public void initDataTypeVariablesWithDefaultValues() {
	}
	
	public void initVariables() {
	}
	
	/**
	 * boolean properties' default values are initialized in the constructor via z_internalBooleanProperties
	 * 
	 * @param loaded 
	 */
	@Override
	public void initialiseProperties(boolean loaded) {
		this.balance =  new UmlgSetImpl(this, PropertyTree.from(AccountRuntimePropertyEnum.balance), loaded);
		this.priority =  new UmlgSetImpl(this, PropertyTree.from(AccountRuntimePropertyEnum.priority), loaded);
		this.owner =  new UmlgSetImpl(this, PropertyTree.from(AccountRuntimePropertyEnum.owner), loaded);
		this.minimum =  new UmlgSetImpl(this, PropertyTree.from(AccountRuntimePropertyEnum.minimum), loaded);
		this.agent =  new UmlgSetImpl(this, PropertyTree.from(AccountRuntimePropertyEnum.agent), loaded);
	}
	
	@Override
	public void initialiseProperty(UmlgRuntimeProperty tumlRuntimeProperty, boolean inverse, boolean loaded) {
		AccountRuntimePropertyEnum runtimeProperty;
		if ( !inverse ) {
			runtimeProperty = (AccountRuntimePropertyEnum.fromQualifiedName(tumlRuntimeProperty.getQualifiedName()));
		} else {
			runtimeProperty = (AccountRuntimePropertyEnum.fromQualifiedName(tumlRuntimeProperty.getInverseQualifiedName()));
		}
		if ( runtimeProperty != null ) {
			switch ( runtimeProperty ) {
				case balance:
					this.balance =  new UmlgSetImpl(this, PropertyTree.from(AccountRuntimePropertyEnum.balance), loaded);
					break;
			
				case priority:
					this.priority =  new UmlgSetImpl(this, PropertyTree.from(AccountRuntimePropertyEnum.priority), loaded);
					break;
			
				case owner:
					this.owner =  new UmlgSetImpl(this, PropertyTree.from(AccountRuntimePropertyEnum.owner), loaded);
					break;
			
				case minimum:
					this.minimum =  new UmlgSetImpl(this, PropertyTree.from(AccountRuntimePropertyEnum.minimum), loaded);
					break;
			
				case agent:
					this.agent =  new UmlgSetImpl(this, PropertyTree.from(AccountRuntimePropertyEnum.agent), loaded);
					break;
			
			}
		
		}
	}
	
	@Override
	public UmlgRuntimeProperty inverseAdder(UmlgRuntimeProperty tumlRuntimeProperty, boolean inverse, UmlgNode umlgNode) {
		AccountRuntimePropertyEnum runtimeProperty;
		if ( !inverse ) {
			runtimeProperty = (AccountRuntimePropertyEnum.fromQualifiedName(tumlRuntimeProperty.getQualifiedName()));
		} else {
			runtimeProperty = (AccountRuntimePropertyEnum.fromQualifiedName(tumlRuntimeProperty.getInverseQualifiedName()));
		}
		if ( runtimeProperty != null ) {
			switch ( runtimeProperty ) {
				case owner:
					this.owner.inverseAdder((LegalEntity)umlgNode);
					break;
			
				case agent:
					this.agent.inverseAdder((LegalEntity)umlgNode);
					break;
			
			}
			
			return runtimeProperty;
		} else {
			return null;
		}
	}
	
	@Override
	public boolean isTinkerRoot() {
		return true;
	}
	
	public UmlgSet lookupFor_accountAgent_agent() {
		UmlgSet result = new UmlgMemorySet();
		Filter filter = new Filter() {
		    @Override
		    public boolean filter(LegalEntity entity){
		        return entity.getAccountAgent() == null;
		    }
		};
		result.addAll(org.umlg.redefinition.LegalEntity.allInstances(filter));
		return result;
	}
	
	public UmlgSet lookupFor_accountOwner_owner() {
		UmlgSet result = new UmlgMemorySet();
		Filter filter = new Filter() {
		    @Override
		    public boolean filter(LegalEntity entity){
		        return entity.getAccountOwner() == null;
		    }
		};
		result.addAll(org.umlg.redefinition.LegalEntity.allInstances(filter));
		return result;
	}
	
	public void removeFromAgent(LegalEntity agent) {
		if ( agent != null ) {
			this.agent.remove(agent);
		}
	}
	
	public void removeFromAgent(UmlgSet agent) {
		if ( !agent.isEmpty() ) {
			this.agent.removeAll(agent);
		}
	}
	
	public void removeFromBalance(Double balance) {
		if ( balance != null ) {
			this.balance.remove(balance);
		}
	}
	
	public void removeFromBalance(UmlgSet balance) {
		if ( !balance.isEmpty() ) {
			this.balance.removeAll(balance);
		}
	}
	
	public void removeFromMinimum(Double minimum) {
		if ( minimum != null ) {
			this.minimum.remove(minimum);
		}
	}
	
	public void removeFromMinimum(UmlgSet minimum) {
		if ( !minimum.isEmpty() ) {
			this.minimum.removeAll(minimum);
		}
	}
	
	public void removeFromOwner(LegalEntity owner) {
		if ( owner != null ) {
			this.owner.remove(owner);
		}
	}
	
	public void removeFromOwner(UmlgSet owner) {
		if ( !owner.isEmpty() ) {
			this.owner.removeAll(owner);
		}
	}
	
	public void removeFromPriority(Integer priority) {
		if ( priority != null ) {
			this.priority.remove(priority);
		}
	}
	
	public void removeFromPriority(UmlgSet priority) {
		if ( !priority.isEmpty() ) {
			this.priority.removeAll(priority);
		}
	}
	
	public void setAgent(UmlgSet agent) {
		clearAgent();
		if ( agent != null ) {
			addToAgent(agent);
		}
	}
	
	public void setBalance(Double balance) {
		if ( balance == null ) {
			clearBalance();
		} else {
			z_internalClearBalance();
		}
		addToBalance(balance);
	}
	
	public void setMinimum(Double minimum) {
		if ( minimum == null ) {
			clearMinimum();
		} else {
			z_internalClearMinimum();
		}
		addToMinimum(minimum);
	}
	
	public void setOwner(UmlgSet owner) {
		clearOwner();
		if ( owner != null ) {
			addToOwner(owner);
		}
	}
	
	public void setPriority(Integer priority) {
		if ( priority == null ) {
			clearPriority();
		} else {
			z_internalClearPriority();
		}
		addToPriority(priority);
	}
	
	/**
	 * deep indicates that components also be serialized.
	 * 
	 * @param deep 
	 */
	@Override
	public String toJson(Boolean deep) {
		StringBuilder sb = new StringBuilder();
		if ( this.tmpId != null ) {
			sb.append("\"tmpId\": \"" + this.tmpId + "\", ");
		}
		sb.append("\"id\": \"" + getId() + "\", ");
		sb.append("\"balance\": " + getBalance() + "");
		sb.append(", ");
		sb.append("\"priority\": " + getPriority() + "");
		sb.append(", ");
		sb.append("\"minimum\": " + getMinimum() + "");
		sb.append(", ");
		sb.append("\"qualifiedName\": \"" + getQualifiedName() + "\"");
		sb.append(", ");
		//PlaceHolder for restful
		sb.append("\"uri\": {}");
		sb.insert(0, "{");
		sb.append("}");
		return sb.toString();
	}
	
	@Override
	public String toJson() {
		return toJson(false);
	}
	
	/**
	 * deep indicates that components also be serialized.
	 * 
	 * @param deep 
	 */
	@Override
	public String toJsonWithoutCompositeParent(Boolean deep) {
		StringBuilder sb = new StringBuilder();
		if ( this.tmpId != null ) {
			sb.append("\"tmpId\": \"" + this.tmpId + "\", ");
		}
		sb.append("\"id\": \"" + getId() + "\", ");
		sb.append("\"balance\": " + getBalance() + "");
		sb.append(", ");
		sb.append("\"priority\": " + getPriority() + "");
		sb.append(", ");
		sb.append("\"minimum\": " + getMinimum() + "");
		sb.append(", ");
		sb.append("\"qualifiedName\": \"" + getQualifiedName() + "\"");
		sb.append(", ");
		//PlaceHolder for restful
		sb.append("\"uri\": {}");
		sb.insert(0, "{");
		sb.append("}");
		return sb.toString();
	}
	
	@Override
	public String toJsonWithoutCompositeParent() {
		return toJsonWithoutCompositeParent(false);
	}
	
	public List validateBalance(Double balance) {
		List result = new ArrayList();
		return result;
	}
	
	public List validateMinimum(Double minimum) {
		List result = new ArrayList();
		return result;
	}
	
	@Override
	public List validateMultiplicities() {
		List result = new ArrayList();
		if ( getBalance() == null ) {
			result.add(new UmlgConstraintViolation("multiplicity", "umlgtest::org::umlg::redefinition::Account::balance", "lower multiplicity is 1"));
		}
		if ( getPriority() == null ) {
			result.add(new UmlgConstraintViolation("multiplicity", "umlgtest::org::umlg::redefinition::Account::priority", "lower multiplicity is 1"));
		}
		if ( getOwner().size() < 1 ) {
			result.add(new UmlgConstraintViolation("multiplicity", "umlgtest::org::umlg::redefinition::Account::owner", "lower multiplicity is 1"));
		}
		if ( getMinimum() == null ) {
			result.add(new UmlgConstraintViolation("multiplicity", "umlgtest::org::umlg::redefinition::Account::minimum", "lower multiplicity is 1"));
		}
		return result;
	}
	
	public List validatePriority(Integer priority) {
		List result = new ArrayList();
		return result;
	}
	
	@Override
	public void z_internalAddPersistentValueToCollection(UmlgRuntimeProperty umlgRuntimeProperty, Object umlgNode) {
		AccountRuntimePropertyEnum runtimeProperty;
		runtimeProperty = (AccountRuntimePropertyEnum.fromQualifiedName(umlgRuntimeProperty.getQualifiedName()));
		if ( runtimeProperty != null ) {
			switch ( runtimeProperty ) {
				case balance:
					this.balance.z_internalAdder((double)umlgNode);
					break;
			
				case priority:
					this.priority.z_internalAdder((int)umlgNode);
					break;
			
				case owner:
					this.owner.z_internalAdder((LegalEntity)umlgNode);
					break;
			
				case minimum:
					this.minimum.z_internalAdder((double)umlgNode);
					break;
			
				case agent:
					this.agent.z_internalAdder((LegalEntity)umlgNode);
					break;
			
			}
		
		}
	}
	
	@Override
	public void z_internalAddToCollection(UmlgRuntimeProperty umlgRuntimeProperty, Object umlgNode) {
		AccountRuntimePropertyEnum runtimeProperty;
		runtimeProperty = (AccountRuntimePropertyEnum.fromQualifiedName(umlgRuntimeProperty.getQualifiedName()));
		if ( runtimeProperty != null ) {
			switch ( runtimeProperty ) {
				case balance:
					this.balance.z_internalAdder((Double)umlgNode);
					break;
			
				case priority:
					this.priority.z_internalAdder((Integer)umlgNode);
					break;
			
				case owner:
					this.owner.z_internalAdder((LegalEntity)umlgNode);
					break;
			
				case minimum:
					this.minimum.z_internalAdder((Double)umlgNode);
					break;
			
				case agent:
					this.agent.z_internalAdder((LegalEntity)umlgNode);
					break;
			
			}
		
		}
	}
	
	@Override
	public Set z_internalBooleanProperties() {
		Set result = new HashSet();
		return result;
	}
	
	public void z_internalClearAgent() {
		this.agent.z_internalClear();
	}
	
	public void z_internalClearBalance() {
		this.balance.z_internalClear();
	}
	
	public void z_internalClearMinimum() {
		this.minimum.z_internalClear();
	}
	
	public void z_internalClearOwner() {
		this.owner.z_internalClear();
	}
	
	public void z_internalClearPriority() {
		this.priority.z_internalClear();
	}
	
	@Override
	public Set z_internalDataTypeProperties() {
		Set result = new HashSet();
		result.add(AccountRuntimePropertyEnum.balance);
		result.add(AccountRuntimePropertyEnum.priority);
		result.add(AccountRuntimePropertyEnum.minimum);
		return result;
	}
	
	@Override
	public Map z_internalDataTypePropertiesWithDefaultValues() {
		Map result = new HashMap();
		result.put(AccountRuntimePropertyEnum.balance, null);
		result.put(AccountRuntimePropertyEnum.minimum, 100.0D);
		return result;
	}
	
	@Override
	public UmlgCollection z_internalGetCollectionFor(UmlgRuntimeProperty tumlRuntimeProperty, boolean inverse) {
		UmlgCollection result = null;
		if ( result == null ) {
			AccountRuntimePropertyEnum runtimeProperty;
			if ( !inverse ) {
				runtimeProperty = (AccountRuntimePropertyEnum.fromQualifiedName(tumlRuntimeProperty.getQualifiedName()));
			} else {
				runtimeProperty = (AccountRuntimePropertyEnum.fromQualifiedName(tumlRuntimeProperty.getInverseQualifiedName()));
			}
			if ( runtimeProperty != null ) {
				switch ( runtimeProperty ) {
					case balance:
						result = this.balance;
						break;
				
					case priority:
						result = this.priority;
						break;
				
					case owner:
						result = this.owner;
						break;
				
					case minimum:
						result = this.minimum;
						break;
				
					case agent:
						result = this.agent;
						break;
				
				}
			
			}
		}
		return result;
	}
	
	@Override
	public UmlgRuntimeProperty z_internalInverseAdder(UmlgRuntimeProperty tumlRuntimeProperty, boolean inverse, UmlgNode umlgNode) {
		AccountRuntimePropertyEnum runtimeProperty;
		if ( !inverse ) {
			runtimeProperty = (AccountRuntimePropertyEnum.fromQualifiedName(tumlRuntimeProperty.getQualifiedName()));
		} else {
			runtimeProperty = (AccountRuntimePropertyEnum.fromQualifiedName(tumlRuntimeProperty.getInverseQualifiedName()));
		}
		if ( runtimeProperty != null ) {
			switch ( runtimeProperty ) {
				case owner:
					this.owner.z_internalAdder((LegalEntity)umlgNode);
					break;
			
				case agent:
					this.agent.z_internalAdder((LegalEntity)umlgNode);
					break;
			
			}
			
			return runtimeProperty;
		} else {
			return null;
		}
	}
	
	@Override
	public void z_internalMarkCollectionLoaded(UmlgRuntimeProperty umlgRuntimeProperty, boolean loaded) {
		AccountRuntimePropertyEnum runtimeProperty;
		runtimeProperty = (AccountRuntimePropertyEnum.fromQualifiedName(umlgRuntimeProperty.getQualifiedName()));
		if ( runtimeProperty != null ) {
			switch ( runtimeProperty ) {
				case balance:
					this.balance.setLoaded(loaded);
					break;
			
				case priority:
					this.priority.setLoaded(loaded);
					break;
			
				case owner:
					this.owner.setLoaded(loaded);
					break;
			
				case minimum:
					this.minimum.setLoaded(loaded);
					break;
			
				case agent:
					this.agent.setLoaded(loaded);
					break;
			
			}
		
		}
	}

	static public enum AccountRuntimePropertyEnum implements UmlgRuntimeProperty {
		balance(/* qualifiedName */ "umlgtest::org::umlg::redefinition::Account::balance",/* persistentName */ "balance",/* inverseName */ "inverseOf::balance",/* inverseQualifiedName */ "inverseOf::umlgtest::org::umlg::redefinition::Account::balance",/* isAssociationClassOne */ false,/* isMemberEndOfAssociationClass */ false,/* associationClassPropertyNameField */ "null",/* inverseAssociationClassPropertyNameField */ "null",/* isAssociationClassProperty */ false,/* isOnePrimitivePropertyOfAssociationClass */ false,/* isOnePrimitive */ true,/* isReadOnly */ false,/* dataTypeEnum */ null,/* validations */ Collections.emptyList(),/* isManyPrimitive */ false,/* oneEnumeration */ false,/* manyEnumeration */ false,/* isControllingSide */ true,/* isComposite */ false,/* isInverseComposite */ false,/* label */ UmlgLabelConverterFactory.getUmlgLabelConverter().convert("balance"),/* isOneToOne */ false,/* isOneToMany */ false,/* isManyToOne */ true,/* isManyToMany */ false,/* upper */ 1,/* lower */ 1,/* inverseUpper */ 1,/* isQualified */ false,/* isInverseQualified */ false,/* isOrdered */ false,/* isInverseOrdered */ false,/* isUnique */ true,/* isInverseUnique */ false,/* isDerived */ false,/* isNavigable */ true,/* propertyType */ Double.class,/* json */ "{\"name\": \"balance\", \"associationClassOne\": false, \"memberEndOfAssociationClass\": false, \"associationClassPropertyName\": null, \"inverseAssociationClassPropertyName\": null, \"associationClassProperty\": false, \"onePrimitivePropertyOfAssociationClass\": false, \"onePrimitive\": true, \"readOnly\": false, \"dataTypeEnum\": null, \"validations\": null, \"qualifiedName\": \"umlgtest::org::umlg::redefinition::Account::balance\", \"persistentName\": \"balance\", \"inverseName\": \"inverseOf::balance\", \"inverseQualifiedName\": \"inverseOf::umlgtest::org::umlg::redefinition::Account::balance\", \"manyPrimitive\": false, \"oneEnumeration\": false, \"manyEnumeration\": false, \"controllingSide\": true, \"composite\": false, \"inverseComposite\": false, \"oneToOne\": false, \"oneToMany\": false, \"manyToOne\": true, \"manyToMany\": false, \"upper\": 1, \"lower\": 1, \"inverseUpper\": 1, \"label\": \"balance\", \"qualified\": false, \"inverseQualified\": false, \"ordered\": false, \"inverseOrdered\": false, \"unique\": true, \"inverseUnique\": false, \"derived\": false, \"navigable\": true}",/* isChangeListenerAttribute */ false),
		priority(/* qualifiedName */ "umlgtest::org::umlg::redefinition::Account::priority",/* persistentName */ "priority",/* inverseName */ "inverseOf::priority",/* inverseQualifiedName */ "inverseOf::umlgtest::org::umlg::redefinition::Account::priority",/* isAssociationClassOne */ false,/* isMemberEndOfAssociationClass */ false,/* associationClassPropertyNameField */ "null",/* inverseAssociationClassPropertyNameField */ "null",/* isAssociationClassProperty */ false,/* isOnePrimitivePropertyOfAssociationClass */ false,/* isOnePrimitive */ true,/* isReadOnly */ false,/* dataTypeEnum */ null,/* validations */ Collections.emptyList(),/* isManyPrimitive */ false,/* oneEnumeration */ false,/* manyEnumeration */ false,/* isControllingSide */ true,/* isComposite */ false,/* isInverseComposite */ false,/* label */ UmlgLabelConverterFactory.getUmlgLabelConverter().convert("priority"),/* isOneToOne */ false,/* isOneToMany */ false,/* isManyToOne */ true,/* isManyToMany */ false,/* upper */ 1,/* lower */ 1,/* inverseUpper */ 1,/* isQualified */ false,/* isInverseQualified */ false,/* isOrdered */ false,/* isInverseOrdered */ false,/* isUnique */ true,/* isInverseUnique */ false,/* isDerived */ false,/* isNavigable */ true,/* propertyType */ Integer.class,/* json */ "{\"name\": \"priority\", \"associationClassOne\": false, \"memberEndOfAssociationClass\": false, \"associationClassPropertyName\": null, \"inverseAssociationClassPropertyName\": null, \"associationClassProperty\": false, \"onePrimitivePropertyOfAssociationClass\": false, \"onePrimitive\": true, \"readOnly\": false, \"dataTypeEnum\": null, \"validations\": null, \"qualifiedName\": \"umlgtest::org::umlg::redefinition::Account::priority\", \"persistentName\": \"priority\", \"inverseName\": \"inverseOf::priority\", \"inverseQualifiedName\": \"inverseOf::umlgtest::org::umlg::redefinition::Account::priority\", \"manyPrimitive\": false, \"oneEnumeration\": false, \"manyEnumeration\": false, \"controllingSide\": true, \"composite\": false, \"inverseComposite\": false, \"oneToOne\": false, \"oneToMany\": false, \"manyToOne\": true, \"manyToMany\": false, \"upper\": 1, \"lower\": 1, \"inverseUpper\": 1, \"label\": \"priority\", \"qualified\": false, \"inverseQualified\": false, \"ordered\": false, \"inverseOrdered\": false, \"unique\": true, \"inverseUnique\": false, \"derived\": false, \"navigable\": true}",/* isChangeListenerAttribute */ false),
		owner(/* qualifiedName */ "umlgtest::org::umlg::redefinition::Account::owner",/* persistentName */ "owner",/* inverseName */ "accountOwner",/* inverseQualifiedName */ "umlgtest::org::umlg::redefinition::account_legalEntity_1::accountOwner",/* isAssociationClassOne */ false,/* isMemberEndOfAssociationClass */ false,/* associationClassPropertyNameField */ "null",/* inverseAssociationClassPropertyNameField */ "null",/* isAssociationClassProperty */ false,/* isOnePrimitivePropertyOfAssociationClass */ false,/* isOnePrimitive */ false,/* isReadOnly */ false,/* dataTypeEnum */ null,/* validations */ Collections.emptyList(),/* isManyPrimitive */ false,/* oneEnumeration */ false,/* manyEnumeration */ false,/* isControllingSide */ true,/* isComposite */ false,/* isInverseComposite */ false,/* label */ UmlgLabelConverterFactory.getUmlgLabelConverter().convert("account_legalEntity_1"),/* isOneToOne */ false,/* isOneToMany */ true,/* isManyToOne */ false,/* isManyToMany */ false,/* upper */ -1,/* lower */ 1,/* inverseUpper */ 1,/* isQualified */ false,/* isInverseQualified */ false,/* isOrdered */ false,/* isInverseOrdered */ false,/* isUnique */ true,/* isInverseUnique */ true,/* isDerived */ false,/* isNavigable */ true,/* propertyType */ LegalEntity.class,/* json */ "{\"name\": \"owner\", \"associationClassOne\": false, \"memberEndOfAssociationClass\": false, \"associationClassPropertyName\": null, \"inverseAssociationClassPropertyName\": null, \"associationClassProperty\": false, \"onePrimitivePropertyOfAssociationClass\": false, \"onePrimitive\": false, \"readOnly\": false, \"dataTypeEnum\": null, \"validations\": null, \"qualifiedName\": \"umlgtest::org::umlg::redefinition::Account::owner\", \"persistentName\": \"owner\", \"inverseName\": \"accountOwner\", \"inverseQualifiedName\": \"umlgtest::org::umlg::redefinition::account_legalEntity_1::accountOwner\", \"manyPrimitive\": false, \"oneEnumeration\": false, \"manyEnumeration\": false, \"controllingSide\": true, \"composite\": false, \"inverseComposite\": false, \"oneToOne\": false, \"oneToMany\": true, \"manyToOne\": false, \"manyToMany\": false, \"upper\": -1, \"lower\": 1, \"inverseUpper\": 1, \"label\": \"account_legalEntity_1\", \"qualified\": false, \"inverseQualified\": false, \"ordered\": false, \"inverseOrdered\": false, \"unique\": true, \"inverseUnique\": true, \"derived\": false, \"navigable\": true}",/* isChangeListenerAttribute */ false),
		minimum(/* qualifiedName */ "umlgtest::org::umlg::redefinition::Account::minimum",/* persistentName */ "minimum",/* inverseName */ "inverseOf::minimum",/* inverseQualifiedName */ "inverseOf::umlgtest::org::umlg::redefinition::Account::minimum",/* isAssociationClassOne */ false,/* isMemberEndOfAssociationClass */ false,/* associationClassPropertyNameField */ "null",/* inverseAssociationClassPropertyNameField */ "null",/* isAssociationClassProperty */ false,/* isOnePrimitivePropertyOfAssociationClass */ false,/* isOnePrimitive */ true,/* isReadOnly */ false,/* dataTypeEnum */ null,/* validations */ Collections.emptyList(),/* isManyPrimitive */ false,/* oneEnumeration */ false,/* manyEnumeration */ false,/* isControllingSide */ true,/* isComposite */ false,/* isInverseComposite */ false,/* label */ UmlgLabelConverterFactory.getUmlgLabelConverter().convert("minimum"),/* isOneToOne */ false,/* isOneToMany */ false,/* isManyToOne */ true,/* isManyToMany */ false,/* upper */ 1,/* lower */ 1,/* inverseUpper */ 1,/* isQualified */ false,/* isInverseQualified */ false,/* isOrdered */ false,/* isInverseOrdered */ false,/* isUnique */ true,/* isInverseUnique */ false,/* isDerived */ false,/* isNavigable */ true,/* propertyType */ Double.class,/* json */ "{\"name\": \"minimum\", \"associationClassOne\": false, \"memberEndOfAssociationClass\": false, \"associationClassPropertyName\": null, \"inverseAssociationClassPropertyName\": null, \"associationClassProperty\": false, \"onePrimitivePropertyOfAssociationClass\": false, \"onePrimitive\": true, \"readOnly\": false, \"dataTypeEnum\": null, \"validations\": null, \"qualifiedName\": \"umlgtest::org::umlg::redefinition::Account::minimum\", \"persistentName\": \"minimum\", \"inverseName\": \"inverseOf::minimum\", \"inverseQualifiedName\": \"inverseOf::umlgtest::org::umlg::redefinition::Account::minimum\", \"manyPrimitive\": false, \"oneEnumeration\": false, \"manyEnumeration\": false, \"controllingSide\": true, \"composite\": false, \"inverseComposite\": false, \"oneToOne\": false, \"oneToMany\": false, \"manyToOne\": true, \"manyToMany\": false, \"upper\": 1, \"lower\": 1, \"inverseUpper\": 1, \"label\": \"minimum\", \"qualified\": false, \"inverseQualified\": false, \"ordered\": false, \"inverseOrdered\": false, \"unique\": true, \"inverseUnique\": false, \"derived\": false, \"navigable\": true}",/* isChangeListenerAttribute */ false),
		agent(/* qualifiedName */ "umlgtest::org::umlg::redefinition::Account::agent",/* persistentName */ "agent",/* inverseName */ "accountAgent",/* inverseQualifiedName */ "umlgtest::org::umlg::redefinition::account_legalEntity_2::accountAgent",/* isAssociationClassOne */ false,/* isMemberEndOfAssociationClass */ false,/* associationClassPropertyNameField */ "null",/* inverseAssociationClassPropertyNameField */ "null",/* isAssociationClassProperty */ false,/* isOnePrimitivePropertyOfAssociationClass */ false,/* isOnePrimitive */ false,/* isReadOnly */ false,/* dataTypeEnum */ null,/* validations */ Collections.emptyList(),/* isManyPrimitive */ false,/* oneEnumeration */ false,/* manyEnumeration */ false,/* isControllingSide */ true,/* isComposite */ false,/* isInverseComposite */ false,/* label */ UmlgLabelConverterFactory.getUmlgLabelConverter().convert("account_legalEntity_2"),/* isOneToOne */ false,/* isOneToMany */ true,/* isManyToOne */ false,/* isManyToMany */ false,/* upper */ -1,/* lower */ 0,/* inverseUpper */ 1,/* isQualified */ false,/* isInverseQualified */ false,/* isOrdered */ false,/* isInverseOrdered */ false,/* isUnique */ true,/* isInverseUnique */ true,/* isDerived */ false,/* isNavigable */ true,/* propertyType */ LegalEntity.class,/* json */ "{\"name\": \"agent\", \"associationClassOne\": false, \"memberEndOfAssociationClass\": false, \"associationClassPropertyName\": null, \"inverseAssociationClassPropertyName\": null, \"associationClassProperty\": false, \"onePrimitivePropertyOfAssociationClass\": false, \"onePrimitive\": false, \"readOnly\": false, \"dataTypeEnum\": null, \"validations\": null, \"qualifiedName\": \"umlgtest::org::umlg::redefinition::Account::agent\", \"persistentName\": \"agent\", \"inverseName\": \"accountAgent\", \"inverseQualifiedName\": \"umlgtest::org::umlg::redefinition::account_legalEntity_2::accountAgent\", \"manyPrimitive\": false, \"oneEnumeration\": false, \"manyEnumeration\": false, \"controllingSide\": true, \"composite\": false, \"inverseComposite\": false, \"oneToOne\": false, \"oneToMany\": true, \"manyToOne\": false, \"manyToMany\": false, \"upper\": -1, \"lower\": 0, \"inverseUpper\": 1, \"label\": \"account_legalEntity_2\", \"qualified\": false, \"inverseQualified\": false, \"ordered\": false, \"inverseOrdered\": false, \"unique\": true, \"inverseUnique\": true, \"derived\": false, \"navigable\": true}",/* isChangeListenerAttribute */ false),
		umlgtest(/* qualifiedName */ "umlgtest",/* persistentName */ "umlgtest",/* inverseName */ "inverseOfumlgtest",/* inverseQualifiedName */ "inverseOfumlgtest",/* isAssociationClassOne */ false,/* isMemberEndOfAssociationClass */ false,/* associationClassPropertyNameField */ "null",/* inverseAssociationClassPropertyNameField */ "null",/* isAssociationClassProperty */ false,/* isOnePrimitivePropertyOfAssociationClass */ false,/* isOnePrimitive */ false,/* isReadOnly */ false,/* dataTypeEnum */ null,/* validations */ Collections.emptyList(),/* isManyPrimitive */ false,/* oneEnumeration */ false,/* manyEnumeration */ false,/* isControllingSide */ true,/* isComposite */ false,/* isInverseComposite */ true,/* label */ UmlgLabelConverterFactory.getUmlgLabelConverter().convert("rootAccount"),/* isOneToOne */ true,/* isOneToMany */ false,/* isManyToOne */ false,/* isManyToMany */ false,/* upper */ -1,/* lower */ 0,/* inverseUpper */ 1,/* isQualified */ false,/* isInverseQualified */ false,/* isOrdered */ false,/* isInverseOrdered */ false,/* isUnique */ false,/* isInverseUnique */ false,/* isDerived */ false,/* isNavigable */ false,/* propertyType */ Object.class,/* json */ "{\"name\": \"umlgtest\", \"associationClassOne\": false, \"memberEndOfAssociationClass\": false, \"associationClassPropertyName\": null, \"inverseAssociationClassPropertyName\": null, \"associationClassProperty\": false, \"onePrimitivePropertyOfAssociationClass\": false, \"onePrimitive\": false, \"readOnly\": false, \"dataTypeEnum\": null, \"validations\": null, \"qualifiedName\": \"umlgtest\", \"persistentName\": \"umlgtest\", \"inverseName\": \"inverseOfumlgtest\", \"inverseQualifiedName\": \"inverseOfumlgtest\", \"manyPrimitive\": false, \"oneEnumeration\": false, \"manyEnumeration\": false, \"controllingSide\": true, \"composite\": false, \"inverseComposite\": true, \"oneToOne\": true, \"oneToMany\": false, \"manyToOne\": false, \"manyToMany\": false, \"upper\": -1, \"lower\": 0, \"inverseUpper\": 1, \"label\": \"rootAccount\", \"qualified\": false, \"inverseQualified\": false, \"ordered\": false, \"inverseOrdered\": false, \"unique\": false, \"inverseUnique\": false, \"derived\": false, \"navigable\": false}",/* isChangeListenerAttribute */ false);
		private String _qualifiedName;
		private String _persistentName;
		private String _inverseName;
		private String _inverseQualifiedName;
		private boolean _associationClassOne;
		private boolean _memberEndOfAssociationClass;
		private String _associationClassPropertyName;
		private String _inverseAssociationClassPropertyName;
		private boolean _associationClassProperty;
		private boolean _onePrimitivePropertyOfAssociationClass;
		private boolean _onePrimitive;
		private Boolean _readOnly;
		private DataTypeEnum dataTypeEnum;
		private List validations;
		private boolean _manyPrimitive;
		private boolean _oneEnumeration;
		private boolean _manyEnumeration;
		private boolean _controllingSide;
		private boolean _composite;
		private boolean _inverseComposite;
		private String _label;
		private boolean _oneToOne;
		private boolean _oneToMany;
		private boolean _manyToOne;
		private boolean _manyToMany;
		private int _upper;
		private int _lower;
		private int _inverseUpper;
		private boolean _qualified;
		private boolean _inverseQualified;
		private boolean _ordered;
		private boolean _inverseOrdered;
		private boolean _unique;
		private boolean _inverseUnique;
		private boolean _derived;
		private boolean _navigability;
		private Class _propertyType;
		private String _json;
		private boolean _changeListener;
		/**
		 * constructor for AccountRuntimePropertyEnum
		 * 
		 * @param _qualifiedName 
		 * @param _persistentName 
		 * @param _inverseName 
		 * @param _inverseQualifiedName 
		 * @param _associationClassOne 
		 * @param _memberEndOfAssociationClass 
		 * @param _associationClassPropertyName 
		 * @param _inverseAssociationClassPropertyName 
		 * @param _associationClassProperty 
		 * @param _onePrimitivePropertyOfAssociationClass 
		 * @param _onePrimitive 
		 * @param _readOnly 
		 * @param dataTypeEnum 
		 * @param validations 
		 * @param _manyPrimitive 
		 * @param _oneEnumeration 
		 * @param _manyEnumeration 
		 * @param _controllingSide 
		 * @param _composite 
		 * @param _inverseComposite 
		 * @param _label 
		 * @param _oneToOne 
		 * @param _oneToMany 
		 * @param _manyToOne 
		 * @param _manyToMany 
		 * @param _upper 
		 * @param _lower 
		 * @param _inverseUpper 
		 * @param _qualified 
		 * @param _inverseQualified 
		 * @param _ordered 
		 * @param _inverseOrdered 
		 * @param _unique 
		 * @param _inverseUnique 
		 * @param _derived 
		 * @param _navigability 
		 * @param _propertyType 
		 * @param _json 
		 * @param _changeListener 
		 */
		private AccountRuntimePropertyEnum(String _qualifiedName, String _persistentName, String _inverseName, String _inverseQualifiedName, boolean _associationClassOne, boolean _memberEndOfAssociationClass, String _associationClassPropertyName, String _inverseAssociationClassPropertyName, boolean _associationClassProperty, boolean _onePrimitivePropertyOfAssociationClass, boolean _onePrimitive, Boolean _readOnly, DataTypeEnum dataTypeEnum, List validations, boolean _manyPrimitive, boolean _oneEnumeration, boolean _manyEnumeration, boolean _controllingSide, boolean _composite, boolean _inverseComposite, String _label, boolean _oneToOne, boolean _oneToMany, boolean _manyToOne, boolean _manyToMany, int _upper, int _lower, int _inverseUpper, boolean _qualified, boolean _inverseQualified, boolean _ordered, boolean _inverseOrdered, boolean _unique, boolean _inverseUnique, boolean _derived, boolean _navigability, Class _propertyType, String _json, boolean _changeListener)  {
			this._qualifiedName = _qualifiedName;
			this._persistentName = _persistentName;
			this._inverseName = _inverseName;
			this._inverseQualifiedName = _inverseQualifiedName;
			this._associationClassOne = _associationClassOne;
			this._memberEndOfAssociationClass = _memberEndOfAssociationClass;
			this._associationClassPropertyName = _associationClassPropertyName;
			this._inverseAssociationClassPropertyName = _inverseAssociationClassPropertyName;
			this._associationClassProperty = _associationClassProperty;
			this._onePrimitivePropertyOfAssociationClass = _onePrimitivePropertyOfAssociationClass;
			this._onePrimitive = _onePrimitive;
			this._readOnly = _readOnly;
			this.dataTypeEnum = dataTypeEnum;
			this.validations = validations;
			this._manyPrimitive = _manyPrimitive;
			this._oneEnumeration = _oneEnumeration;
			this._manyEnumeration = _manyEnumeration;
			this._controllingSide = _controllingSide;
			this._composite = _composite;
			this._inverseComposite = _inverseComposite;
			this._label = _label;
			this._oneToOne = _oneToOne;
			this._oneToMany = _oneToMany;
			this._manyToOne = _manyToOne;
			this._manyToMany = _manyToMany;
			this._upper = _upper;
			this._lower = _lower;
			this._inverseUpper = _inverseUpper;
			this._qualified = _qualified;
			this._inverseQualified = _inverseQualified;
			this._ordered = _ordered;
			this._inverseOrdered = _inverseOrdered;
			this._unique = _unique;
			this._inverseUnique = _inverseUnique;
			this._derived = _derived;
			this._navigability = _navigability;
			this._propertyType = _propertyType;
			this._json = _json;
			this._changeListener = _changeListener;
		}
	
		static public String asJson() {
			int count = 1;
			StringBuilder sb = new StringBuilder();;
			sb.append("{\"name\": \"Account\", ");
			sb.append("\"qualifiedName\": \"umlgtest::org::umlg::redefinition::Account\", ");
			sb.append("\"uri\": \"TODO\", ");
			sb.append("\"properties\": [");
			for ( AccountRuntimePropertyEnum l : AccountRuntimePropertyEnum.values() ) {
				sb.append(l.toJson());
				if ( count < AccountRuntimePropertyEnum.values().length ) {
					count++;
					sb.append(",");
				}
			}
			sb.append("]}");
			return sb.toString();
		}
		
		static public AccountRuntimePropertyEnum fromInverseQualifiedName(String inverseQualifiedName) {
			if ( umlgtest.getInverseQualifiedName().equals(inverseQualifiedName) ) {
				return umlgtest;
			}
			if ( agent.getInverseQualifiedName().equals(inverseQualifiedName) ) {
				return agent;
			}
			if ( minimum.getInverseQualifiedName().equals(inverseQualifiedName) ) {
				return minimum;
			}
			if ( owner.getInverseQualifiedName().equals(inverseQualifiedName) ) {
				return owner;
			}
			if ( priority.getInverseQualifiedName().equals(inverseQualifiedName) ) {
				return priority;
			}
			if ( balance.getInverseQualifiedName().equals(inverseQualifiedName) ) {
				return balance;
			}
			return null;
		}
		
		static public AccountRuntimePropertyEnum fromLabel(String _label) {
			if ( umlgtest.getLabel().equals(_label) ) {
				return umlgtest;
			}
			if ( agent.getLabel().equals(_label) ) {
				return agent;
			}
			if ( minimum.getLabel().equals(_label) ) {
				return minimum;
			}
			if ( owner.getLabel().equals(_label) ) {
				return owner;
			}
			if ( priority.getLabel().equals(_label) ) {
				return priority;
			}
			if ( balance.getLabel().equals(_label) ) {
				return balance;
			}
			return null;
		}
		
		static public AccountRuntimePropertyEnum fromQualifiedName(String qualifiedName) {
			if ( umlgtest.getQualifiedName().equals(qualifiedName) ) {
				return umlgtest;
			}
			if ( agent.getQualifiedName().equals(qualifiedName) ) {
				return agent;
			}
			if ( minimum.getQualifiedName().equals(qualifiedName) ) {
				return minimum;
			}
			if ( owner.getQualifiedName().equals(qualifiedName) ) {
				return owner;
			}
			if ( priority.getQualifiedName().equals(qualifiedName) ) {
				return priority;
			}
			if ( balance.getQualifiedName().equals(qualifiedName) ) {
				return balance;
			}
			return null;
		}
		
		public String getAssociationClassPropertyName() {
			return this._associationClassPropertyName;
		}
		
		public DataTypeEnum getDataTypeEnum() {
			return this.dataTypeEnum;
		}
		
		public String getInverseAssociationClassPropertyName() {
			return this._inverseAssociationClassPropertyName;
		}
		
		public String getInverseName() {
			return this._inverseName;
		}
		
		public String getInverseQualifiedName() {
			return this._inverseQualifiedName;
		}
		
		public int getInverseUpper() {
			return this._inverseUpper;
		}
		
		public String getJson() {
			return this._json;
		}
		
		public String getLabel() {
			return this._label;
		}
		
		public int getLower() {
			return this._lower;
		}
		
		public String getPersistentName() {
			return this._persistentName;
		}
		
		public Class getPropertyType() {
			return this._propertyType;
		}
		
		public String getQualifiedName() {
			return this._qualifiedName;
		}
		
		public Boolean getReadOnly() {
			return this._readOnly;
		}
		
		public int getUpper() {
			return this._upper;
		}
		
		public List getValidations() {
			return this.validations;
		}
		
		public boolean isAssociationClassOne() {
			return this._associationClassOne;
		}
		
		public boolean isAssociationClassProperty() {
			return this._associationClassProperty;
		}
		
		public boolean isChangeListener() {
			return this._changeListener;
		}
		
		public boolean isComposite() {
			return this._composite;
		}
		
		public boolean isControllingSide() {
			return this._controllingSide;
		}
		
		public boolean isDerived() {
			return this._derived;
		}
		
		public boolean isInverseComposite() {
			return this._inverseComposite;
		}
		
		public boolean isInverseOrdered() {
			return this._inverseOrdered;
		}
		
		public boolean isInverseQualified() {
			return this._inverseQualified;
		}
		
		public boolean isInverseUnique() {
			return this._inverseUnique;
		}
		
		public boolean isManyEnumeration() {
			return this._manyEnumeration;
		}
		
		public boolean isManyPrimitive() {
			return this._manyPrimitive;
		}
		
		public boolean isManyToMany() {
			return this._manyToMany;
		}
		
		public boolean isManyToOne() {
			return this._manyToOne;
		}
		
		public boolean isMemberEndOfAssociationClass() {
			return this._memberEndOfAssociationClass;
		}
		
		public boolean isNavigability() {
			return this._navigability;
		}
		
		public boolean isOneEnumeration() {
			return this._oneEnumeration;
		}
		
		public boolean isOnePrimitive() {
			return this._onePrimitive;
		}
		
		public boolean isOnePrimitivePropertyOfAssociationClass() {
			return this._onePrimitivePropertyOfAssociationClass;
		}
		
		public boolean isOneToMany() {
			return this._oneToMany;
		}
		
		public boolean isOneToOne() {
			return this._oneToOne;
		}
		
		public boolean isOrdered() {
			return this._ordered;
		}
		
		public boolean isQualified() {
			return this._qualified;
		}
		
		public boolean isUnique() {
			return this._unique;
		}
		
		@Override
		public boolean isValid(int elementCount) {
			if ( isQualified() ) {
				return elementCount >= getLower();
			} else {
				return (getUpper() == -1 || elementCount <= getUpper()) && elementCount >= getLower();
			}
		}
		
		@Override
		public String toJson() {
			return getJson();
		}
	
	
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy