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

org.umlg.embeddedtest.TestEmbedded Maven / Gradle / Ivy

The newest version!
package org.umlg.embeddedtest;

import com.fasterxml.jackson.databind.ObjectMapper;

import java.util.ArrayList;
import java.util.Arrays;
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.concretetest.God;
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.UmlgBag;
import org.umlg.runtime.collection.UmlgCollection;
import org.umlg.runtime.collection.UmlgOrderedSet;
import org.umlg.runtime.collection.UmlgRuntimeProperty;
import org.umlg.runtime.collection.UmlgSequence;
import org.umlg.runtime.collection.UmlgSet;
import org.umlg.runtime.collection.memory.UmlgMemoryBag;
import org.umlg.runtime.collection.memory.UmlgMemoryOrderedSet;
import org.umlg.runtime.collection.memory.UmlgMemorySequence;
import org.umlg.runtime.collection.memory.UmlgMemorySet;
import org.umlg.runtime.collection.persistent.PropertyTree;
import org.umlg.runtime.collection.persistent.UmlgBagImpl;
import org.umlg.runtime.collection.persistent.UmlgOrderedSetImpl;
import org.umlg.runtime.collection.persistent.UmlgSequenceImpl;
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.domain.json.ToJsonUtil;
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 TestEmbedded extends BaseUmlgCompositionNode implements CompositionNode {
	static final public long serialVersionUID = 1L;
	private UmlgSet god;
	private UmlgSet name;
	private UmlgSequence manyOrderedRequiredInteger;
	private UmlgOrderedSet manyRequiredOrderedUniqueString;
	private UmlgBag manyBoolean;
	private UmlgOrderedSet manyOrderedString;
	private String tmpId;	// tmpId is only used the umlg restlet gui. It is never persisted. Its value is generated by the gui.

	/**
	 * constructor for TestEmbedded
	 * 
	 * @param compositeOwner 
	 */
	public TestEmbedded(God compositeOwner)  {
		super(true);
		compositeOwner.addToTestEmbedded(this);
	}
	
	/**
	 * constructor for TestEmbedded
	 * 
	 * @param id 
	 */
	public TestEmbedded(Object id)  {
		super(id);
	}
	
	/**
	 * constructor for TestEmbedded
	 * 
	 * @param vertex 
	 */
	public TestEmbedded(Vertex vertex)  {
		super(vertex);
	}
	
	/**
	 * default constructor for TestEmbedded
	 */
	public TestEmbedded()  {
		this(true);
	}
	
	/**
	 * constructor for TestEmbedded
	 * 
	 * @param persistent 
	 */
	public TestEmbedded(Boolean persistent)  {
		super(persistent);
	}

	public void addToGod(God god) {
		if ( god != null ) {
			if ( !this.god.isEmpty() ) {
				throw new RuntimeException("Property umlgtest::org::umlg::concretetest::god_testEmbedded_1::god is a one and already has a value!");
			}
			this.god.add(god);
		}
	}
	
	public void addToGodIgnoreInverse(God god) {
		if ( god != null ) {
			if ( !this.god.isEmpty() ) {
				throw new RuntimeException("Property umlgtest::org::umlg::concretetest::god_testEmbedded_1::god is a one and already has a value!");
			}
			this.god.addIgnoreInverse(god);
		}
	}
	
	public void addToManyBoolean(Boolean manyBoolean) {
		if ( manyBoolean != null ) {
			List violations = validateManyBoolean(manyBoolean);
			if ( violations.isEmpty() ) {
				this.manyBoolean.add(manyBoolean);
			} else {
				throw new UmlgConstraintViolationException(violations);
			}
		}
	}
	
	public void addToManyBoolean(UmlgBag manyBoolean) {
		if ( !manyBoolean.isEmpty() ) {
			this.manyBoolean.addAll(manyBoolean);
		}
	}
	
	public void addToManyBooleanIgnoreInverse(Boolean manyBoolean) {
		if ( manyBoolean != null ) {
			List violations = validateManyBoolean(manyBoolean);
			if ( violations.isEmpty() ) {
				this.manyBoolean.addIgnoreInverse(manyBoolean);
			} else {
				throw new UmlgConstraintViolationException(violations);
			}
		}
	}
	
	public void addToManyOrderedRequiredInteger(Integer manyOrderedRequiredInteger) {
		if ( manyOrderedRequiredInteger != null ) {
			List violations = validateManyOrderedRequiredInteger(manyOrderedRequiredInteger);
			if ( violations.isEmpty() ) {
				this.manyOrderedRequiredInteger.add(manyOrderedRequiredInteger);
			} else {
				throw new UmlgConstraintViolationException(violations);
			}
		}
	}
	
	public void addToManyOrderedRequiredInteger(UmlgSequence manyOrderedRequiredInteger) {
		if ( !manyOrderedRequiredInteger.isEmpty() ) {
			this.manyOrderedRequiredInteger.addAll(manyOrderedRequiredInteger);
		}
	}
	
	public void addToManyOrderedRequiredInteger(int index, Integer manyOrderedRequiredInteger) {
		if ( manyOrderedRequiredInteger != null ) {
			List violations = validateManyOrderedRequiredInteger(manyOrderedRequiredInteger);
			if ( violations.isEmpty() ) {
				this.manyOrderedRequiredInteger.add(index, manyOrderedRequiredInteger);
			} else {
				throw new UmlgConstraintViolationException(violations);
			}
		}
	}
	
	public void addToManyOrderedRequiredInteger(int index, UmlgSequence manyOrderedRequiredInteger) {
		if ( !manyOrderedRequiredInteger.isEmpty() ) {
			this.manyOrderedRequiredInteger.addAll(manyOrderedRequiredInteger);
		}
	}
	
	public void addToManyOrderedRequiredIntegerIgnoreInverse(Integer manyOrderedRequiredInteger) {
		if ( manyOrderedRequiredInteger != null ) {
			List violations = validateManyOrderedRequiredInteger(manyOrderedRequiredInteger);
			if ( violations.isEmpty() ) {
				this.manyOrderedRequiredInteger.addIgnoreInverse(manyOrderedRequiredInteger);
			} else {
				throw new UmlgConstraintViolationException(violations);
			}
		}
	}
	
	public void addToManyOrderedString(String manyOrderedString) {
		if ( manyOrderedString != null ) {
			List violations = validateManyOrderedString(manyOrderedString);
			if ( violations.isEmpty() ) {
				this.manyOrderedString.add(manyOrderedString);
			} else {
				throw new UmlgConstraintViolationException(violations);
			}
		}
	}
	
	public void addToManyOrderedString(UmlgOrderedSet manyOrderedString) {
		if ( !manyOrderedString.isEmpty() ) {
			this.manyOrderedString.addAll(manyOrderedString);
		}
	}
	
	public void addToManyOrderedString(int index, String manyOrderedString) {
		if ( manyOrderedString != null ) {
			List violations = validateManyOrderedString(manyOrderedString);
			if ( violations.isEmpty() ) {
				this.manyOrderedString.add(index, manyOrderedString);
			} else {
				throw new UmlgConstraintViolationException(violations);
			}
		}
	}
	
	public void addToManyOrderedString(int index, UmlgOrderedSet manyOrderedString) {
		if ( !manyOrderedString.isEmpty() ) {
			this.manyOrderedString.addAll(manyOrderedString);
		}
	}
	
	public void addToManyOrderedStringIgnoreInverse(String manyOrderedString) {
		if ( manyOrderedString != null ) {
			List violations = validateManyOrderedString(manyOrderedString);
			if ( violations.isEmpty() ) {
				this.manyOrderedString.addIgnoreInverse(manyOrderedString);
			} else {
				throw new UmlgConstraintViolationException(violations);
			}
		}
	}
	
	public void addToManyRequiredOrderedUniqueString(String manyRequiredOrderedUniqueString) {
		if ( manyRequiredOrderedUniqueString != null ) {
			List violations = validateManyRequiredOrderedUniqueString(manyRequiredOrderedUniqueString);
			if ( violations.isEmpty() ) {
				this.manyRequiredOrderedUniqueString.add(manyRequiredOrderedUniqueString);
			} else {
				throw new UmlgConstraintViolationException(violations);
			}
		}
	}
	
	public void addToManyRequiredOrderedUniqueString(UmlgOrderedSet manyRequiredOrderedUniqueString) {
		if ( !manyRequiredOrderedUniqueString.isEmpty() ) {
			this.manyRequiredOrderedUniqueString.addAll(manyRequiredOrderedUniqueString);
		}
	}
	
	public void addToManyRequiredOrderedUniqueString(int index, String manyRequiredOrderedUniqueString) {
		if ( manyRequiredOrderedUniqueString != null ) {
			List violations = validateManyRequiredOrderedUniqueString(manyRequiredOrderedUniqueString);
			if ( violations.isEmpty() ) {
				this.manyRequiredOrderedUniqueString.add(index, manyRequiredOrderedUniqueString);
			} else {
				throw new UmlgConstraintViolationException(violations);
			}
		}
	}
	
	public void addToManyRequiredOrderedUniqueString(int index, UmlgOrderedSet manyRequiredOrderedUniqueString) {
		if ( !manyRequiredOrderedUniqueString.isEmpty() ) {
			this.manyRequiredOrderedUniqueString.addAll(manyRequiredOrderedUniqueString);
		}
	}
	
	public void addToManyRequiredOrderedUniqueStringIgnoreInverse(String manyRequiredOrderedUniqueString) {
		if ( manyRequiredOrderedUniqueString != null ) {
			List violations = validateManyRequiredOrderedUniqueString(manyRequiredOrderedUniqueString);
			if ( violations.isEmpty() ) {
				this.manyRequiredOrderedUniqueString.addIgnoreInverse(manyRequiredOrderedUniqueString);
			} else {
				throw new UmlgConstraintViolationException(violations);
			}
		}
	}
	
	public void addToName(String name) {
		if ( !this.name.isEmpty() ) {
			throw new RuntimeException("Property is a one and already has value, first clear it before adding!");
		}
		if ( name != null ) {
			List violations = validateName(name);
			if ( violations.isEmpty() ) {
				this.name.add(name);
			} else {
				throw new UmlgConstraintViolationException(violations);
			}
		}
	}
	
	public void addToNameIgnoreInverse(String name) {
		if ( !this.name.isEmpty() ) {
			throw new RuntimeException("Property is a one and already has value, first clear it before adding!");
		}
		if ( name != null ) {
			List violations = validateName(name);
			if ( violations.isEmpty() ) {
				this.name.add(name);
			} else {
				throw new UmlgConstraintViolationException(violations);
			}
		}
	}
	
	static public UmlgSet allInstances(Filter filter) {
		UmlgSet result = new UmlgMemorySet();
		result.addAll(UMLG.get().allInstances(TestEmbedded.class.getName(), filter));
		return result;
	}
	
	static public UmlgSet allInstances() {
		UmlgSet result = new UmlgMemorySet();
		result.addAll(UMLG.get().allInstances(TestEmbedded.class.getName()));
		return result;
	}
	
	@Override
	public List checkClassConstraints() {
		List result = new ArrayList();
		return result;
	}
	
	public void clearGod() {
		this.god.clear();
	}
	
	public void clearManyBoolean() {
		this.manyBoolean.clear();
	}
	
	public void clearManyOrderedRequiredInteger() {
		this.manyOrderedRequiredInteger.clear();
	}
	
	public void clearManyOrderedString() {
		this.manyOrderedString.clear();
	}
	
	public void clearManyRequiredOrderedUniqueString() {
		this.manyRequiredOrderedUniqueString.clear();
	}
	
	public void clearName() {
		this.name.clear();
	}
	
	@Override
	public void delete() {
		this.god.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) {
		if ( propertyMap.containsKey("manyRequiredOrderedUniqueString") ) {
			if ( propertyMap.get("manyRequiredOrderedUniqueString") != null ) {
				UmlgOrderedSet manyRequiredOrderedUniqueString = new UmlgMemoryOrderedSet((Collection)propertyMap.get("manyRequiredOrderedUniqueString"));
				clearManyRequiredOrderedUniqueString();
				for ( String value : manyRequiredOrderedUniqueString ) {
					addToManyRequiredOrderedUniqueString(String.valueOf(value));
				}
			} else {
				setManyRequiredOrderedUniqueString(null);
			}
		}
		if ( propertyMap.containsKey("manyBoolean") ) {
			if ( propertyMap.get("manyBoolean") != null ) {
				UmlgBag manyBoolean = new UmlgMemoryBag((Collection)propertyMap.get("manyBoolean"));
				clearManyBoolean();
				for ( Boolean value : manyBoolean ) {
					addToManyBoolean(Boolean.valueOf(value));
				}
			} else {
				setManyBoolean(null);
			}
		}
		if ( propertyMap.containsKey("name") ) {
			if ( propertyMap.get("name") != null ) {
				String name = (String)propertyMap.get("name");
				setName(name);
			} else {
				setName(null);
			}
		}
		if ( propertyMap.containsKey("manyOrderedRequiredInteger") ) {
			if ( propertyMap.get("manyOrderedRequiredInteger") != null ) {
				UmlgSequence manyOrderedRequiredInteger = new UmlgMemorySequence((Collection)propertyMap.get("manyOrderedRequiredInteger"));
				clearManyOrderedRequiredInteger();
				for ( Number value : manyOrderedRequiredInteger ) {
					addToManyOrderedRequiredInteger(value.intValue());
				}
			} else {
				setManyOrderedRequiredInteger(null);
			}
		}
		if ( propertyMap.containsKey("manyOrderedString") ) {
			if ( propertyMap.get("manyOrderedString") != null ) {
				UmlgOrderedSet manyOrderedString = new UmlgMemoryOrderedSet((Collection)propertyMap.get("manyOrderedString"));
				clearManyOrderedString();
				for ( String value : manyOrderedString ) {
					addToManyOrderedString(String.valueOf(value));
				}
			} else {
				setManyOrderedString(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) {
	}
	
	public God getGod() {
		UmlgSet tmp = this.god;
		if ( !tmp.isEmpty() ) {
			return tmp.iterator().next();
		} else {
			return null;
		}
	}
	
	public UmlgBag getManyBoolean() {
		return this.manyBoolean;
	}
	
	public UmlgSequence getManyOrderedRequiredInteger() {
		return this.manyOrderedRequiredInteger;
	}
	
	public UmlgOrderedSet getManyOrderedString() {
		return this.manyOrderedString;
	}
	
	public UmlgOrderedSet getManyRequiredOrderedUniqueString() {
		return this.manyRequiredOrderedUniqueString;
	}
	
	@Override
	public String getMetaDataAsJson() {
		return TestEmbedded.TestEmbeddedRuntimePropertyEnum.asJson();
	}
	
	public String getName() {
		UmlgSet tmp = this.name;
		if ( !tmp.isEmpty() ) {
			return tmp.iterator().next();
		} else {
			return null;
		}
	}
	
	@Override
	public UmlgNode getOwningObject() {
		UmlgNode result;
		if ( getGod() != null ) {
			result = getGod();
		} else {
			result = null;
		}
		return result;
	}
	
	@Override
	public String getQualifiedName() {
		return "umlgtest::org::umlg::embeddedtest::TestEmbedded";
	}
	
	/**
	 * 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();
		TestEmbeddedRuntimePropertyEnum runtimeProperty;
		if ( !inverse ) {
			runtimeProperty = TestEmbeddedRuntimePropertyEnum.fromQualifiedName(tumlRuntimeProperty.getQualifiedName());
		} else {
			runtimeProperty = TestEmbeddedRuntimePropertyEnum.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;
		TestEmbeddedRuntimePropertyEnum runtimeProperty;
		if ( !inverse ) {
			runtimeProperty = TestEmbeddedRuntimePropertyEnum.fromQualifiedName(tumlRuntimeProperty.getQualifiedName());
		} else {
			runtimeProperty = TestEmbeddedRuntimePropertyEnum.fromQualifiedName(tumlRuntimeProperty.getInverseQualifiedName());
		}
		if ( runtimeProperty != null && result == 0 ) {
			switch ( runtimeProperty ) {
				case manyRequiredOrderedUniqueString:
					result = manyRequiredOrderedUniqueString.size();
					break;
			
				case manyBoolean:
					result = manyBoolean.size();
					break;
			
				case name:
					result = name.size();
					break;
			
				case manyOrderedRequiredInteger:
					result = manyOrderedRequiredInteger.size();
					break;
			
				case god:
					result = god.size();
					break;
			
				case manyOrderedString:
					result = manyOrderedString.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;
		result = result + (getGod() != null ? 1 : 0);
		return result == 1;
	}
	
	public void initDataTypeVariablesWithDefaultValues() {
	}
	
	/**
	 * Implements the ocl statement for initialization variable 'manyRequiredOrderedUniqueString'
	 * 
	 * package umlgtest::org::umlg::embeddedtest
	 *     context TestEmbedded::manyRequiredOrderedUniqueString : OrderedSet(PrimitiveTypes::String)
	 *     derive: OrderedSet{'a', 'b', 'c'}
	 * endpackage
	 * 
*/ public void initVariables() { setManyOrderedRequiredInteger(new UmlgMemorySequence(Arrays.asList(1, 2, 3))); setManyRequiredOrderedUniqueString(new UmlgMemoryOrderedSet(Arrays.asList("a", "b", "c"))); } /** * boolean properties' default values are initialized in the constructor via z_internalBooleanProperties * * @param loaded */ @Override public void initialiseProperties(boolean loaded) { this.manyRequiredOrderedUniqueString = new UmlgOrderedSetImpl(this, PropertyTree.from(TestEmbeddedRuntimePropertyEnum.manyRequiredOrderedUniqueString), loaded); this.manyBoolean = new UmlgBagImpl(this, PropertyTree.from(TestEmbeddedRuntimePropertyEnum.manyBoolean), loaded); this.name = new UmlgSetImpl(this, PropertyTree.from(TestEmbeddedRuntimePropertyEnum.name), loaded); this.manyOrderedRequiredInteger = new UmlgSequenceImpl(this, PropertyTree.from(TestEmbeddedRuntimePropertyEnum.manyOrderedRequiredInteger), loaded); this.god = new UmlgSetImpl(this, PropertyTree.from(TestEmbeddedRuntimePropertyEnum.god), loaded); this.manyOrderedString = new UmlgOrderedSetImpl(this, PropertyTree.from(TestEmbeddedRuntimePropertyEnum.manyOrderedString), loaded); } @Override public void initialiseProperty(UmlgRuntimeProperty tumlRuntimeProperty, boolean inverse, boolean loaded) { TestEmbeddedRuntimePropertyEnum runtimeProperty; if ( !inverse ) { runtimeProperty = (TestEmbeddedRuntimePropertyEnum.fromQualifiedName(tumlRuntimeProperty.getQualifiedName())); } else { runtimeProperty = (TestEmbeddedRuntimePropertyEnum.fromQualifiedName(tumlRuntimeProperty.getInverseQualifiedName())); } if ( runtimeProperty != null ) { switch ( runtimeProperty ) { case manyRequiredOrderedUniqueString: this.manyRequiredOrderedUniqueString = new UmlgOrderedSetImpl(this, PropertyTree.from(TestEmbeddedRuntimePropertyEnum.manyRequiredOrderedUniqueString), loaded); break; case manyBoolean: this.manyBoolean = new UmlgBagImpl(this, PropertyTree.from(TestEmbeddedRuntimePropertyEnum.manyBoolean), loaded); break; case name: this.name = new UmlgSetImpl(this, PropertyTree.from(TestEmbeddedRuntimePropertyEnum.name), loaded); break; case manyOrderedRequiredInteger: this.manyOrderedRequiredInteger = new UmlgSequenceImpl(this, PropertyTree.from(TestEmbeddedRuntimePropertyEnum.manyOrderedRequiredInteger), loaded); break; case god: this.god = new UmlgSetImpl(this, PropertyTree.from(TestEmbeddedRuntimePropertyEnum.god), loaded); break; case manyOrderedString: this.manyOrderedString = new UmlgOrderedSetImpl(this, PropertyTree.from(TestEmbeddedRuntimePropertyEnum.manyOrderedString), loaded); break; } } } @Override public UmlgRuntimeProperty inverseAdder(UmlgRuntimeProperty tumlRuntimeProperty, boolean inverse, UmlgNode umlgNode) { TestEmbeddedRuntimePropertyEnum runtimeProperty; if ( !inverse ) { runtimeProperty = (TestEmbeddedRuntimePropertyEnum.fromQualifiedName(tumlRuntimeProperty.getQualifiedName())); } else { runtimeProperty = (TestEmbeddedRuntimePropertyEnum.fromQualifiedName(tumlRuntimeProperty.getInverseQualifiedName())); } if ( runtimeProperty != null ) { switch ( runtimeProperty ) { case god: this.god.inverseAdder((God)umlgNode); break; } return runtimeProperty; } else { return null; } } @Override public boolean isTinkerRoot() { return false; } public void removeFromGod(God god) { if ( god != null ) { this.god.remove(god); } } public void removeFromGod(UmlgSet god) { if ( !god.isEmpty() ) { this.god.removeAll(god); } } public void removeFromManyBoolean(Boolean manyBoolean) { if ( manyBoolean != null ) { this.manyBoolean.remove(manyBoolean); } } public void removeFromManyBoolean(UmlgBag manyBoolean) { if ( !manyBoolean.isEmpty() ) { this.manyBoolean.removeAll(manyBoolean); } } public void removeFromManyOrderedRequiredInteger(Integer manyOrderedRequiredInteger) { if ( manyOrderedRequiredInteger != null ) { this.manyOrderedRequiredInteger.remove(manyOrderedRequiredInteger); } } public void removeFromManyOrderedRequiredInteger(UmlgSequence manyOrderedRequiredInteger) { if ( !manyOrderedRequiredInteger.isEmpty() ) { this.manyOrderedRequiredInteger.removeAll(manyOrderedRequiredInteger); } } public void removeFromManyOrderedString(String manyOrderedString) { if ( manyOrderedString != null ) { this.manyOrderedString.remove(manyOrderedString); } } public void removeFromManyOrderedString(UmlgOrderedSet manyOrderedString) { if ( !manyOrderedString.isEmpty() ) { this.manyOrderedString.removeAll(manyOrderedString); } } public void removeFromManyRequiredOrderedUniqueString(String manyRequiredOrderedUniqueString) { if ( manyRequiredOrderedUniqueString != null ) { this.manyRequiredOrderedUniqueString.remove(manyRequiredOrderedUniqueString); } } public void removeFromManyRequiredOrderedUniqueString(UmlgOrderedSet manyRequiredOrderedUniqueString) { if ( !manyRequiredOrderedUniqueString.isEmpty() ) { this.manyRequiredOrderedUniqueString.removeAll(manyRequiredOrderedUniqueString); } } public void removeFromName(String name) { if ( name != null ) { this.name.remove(name); } } public void removeFromName(UmlgSet name) { if ( !name.isEmpty() ) { this.name.removeAll(name); } } public void setGod(God god) { clearGod(); addToGod(god); } public void setManyBoolean(UmlgBag manyBoolean) { clearManyBoolean(); if ( manyBoolean != null ) { addToManyBoolean(manyBoolean); } } public void setManyOrderedRequiredInteger(UmlgSequence manyOrderedRequiredInteger) { clearManyOrderedRequiredInteger(); if ( manyOrderedRequiredInteger != null ) { addToManyOrderedRequiredInteger(manyOrderedRequiredInteger); } } public void setManyOrderedString(UmlgOrderedSet manyOrderedString) { clearManyOrderedString(); if ( manyOrderedString != null ) { addToManyOrderedString(manyOrderedString); } } public void setManyRequiredOrderedUniqueString(UmlgOrderedSet manyRequiredOrderedUniqueString) { clearManyRequiredOrderedUniqueString(); if ( manyRequiredOrderedUniqueString != null ) { addToManyRequiredOrderedUniqueString(manyRequiredOrderedUniqueString); } } public void setName(String name) { if ( name == null ) { clearName(); } else { z_internalClearName(); } addToName(name); } /** * 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("\"manyRequiredOrderedUniqueString\": " + ToJsonUtil.primitivesToJson(getManyRequiredOrderedUniqueString()) + ""); sb.append(", "); sb.append("\"manyBoolean\": " + ToJsonUtil.primitivesToJson(getManyBoolean()) + ""); sb.append(", "); sb.append("\"name\": " + (getName() != null ? "\"" + StringEscapeUtils.escapeJson(getName()) + "\"" : null )); sb.append(", "); sb.append("\"manyOrderedRequiredInteger\": " + ToJsonUtil.primitivesToJson(getManyOrderedRequiredInteger()) + ""); sb.append(", "); if ( getGod() != null ) { if ( UmlgTmpIdManager.INSTANCE.get(getGod().getId()) != null ) { sb.append("\"god\": " + "{\"id\": \"" + getGod().getId() + "\", \"tmpId\": \"" + UmlgTmpIdManager.INSTANCE.get(getGod().getId()) + "\",\"displayName\": \"" + getGod().getName() + "\"}" + ""); } else { sb.append("\"god\": " + "{\"id\": \"" + getGod().getId() + "\", \"displayName\": \"" + getGod().getName() + "\"}" + ""); } } else { sb.append("\"god\": " + "{\"id\": " + null + ", \"displayName\": " + null + "}"); } sb.append(", "); sb.append("\"manyOrderedString\": " + ToJsonUtil.primitivesToJson(getManyOrderedString()) + ""); 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("\"manyRequiredOrderedUniqueString\": " + ToJsonUtil.primitivesToJson(getManyRequiredOrderedUniqueString()) + ""); sb.append(", "); sb.append("\"manyBoolean\": " + ToJsonUtil.primitivesToJson(getManyBoolean()) + ""); sb.append(", "); sb.append("\"name\": " + (getName() != null ? "\"" + StringEscapeUtils.escapeJson(getName()) + "\"" : null )); sb.append(", "); sb.append("\"manyOrderedRequiredInteger\": " + ToJsonUtil.primitivesToJson(getManyOrderedRequiredInteger()) + ""); sb.append(", "); sb.append("\"manyOrderedString\": " + ToJsonUtil.primitivesToJson(getManyOrderedString()) + ""); 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 validateManyBoolean(Boolean manyBoolean) { List result = new ArrayList(); return result; } public List validateManyOrderedRequiredInteger(Integer manyOrderedRequiredInteger) { List result = new ArrayList(); return result; } public List validateManyOrderedString(String manyOrderedString) { List result = new ArrayList(); return result; } public List validateManyRequiredOrderedUniqueString(String manyRequiredOrderedUniqueString) { List result = new ArrayList(); return result; } @Override public List validateMultiplicities() { List result = new ArrayList(); if ( getManyRequiredOrderedUniqueString().size() < 1 ) { result.add(new UmlgConstraintViolation("multiplicity", "umlgtest::org::umlg::embeddedtest::TestEmbedded::manyRequiredOrderedUniqueString", "lower multiplicity is 1")); } if ( getName() == null ) { result.add(new UmlgConstraintViolation("multiplicity", "umlgtest::org::umlg::embeddedtest::TestEmbedded::name", "lower multiplicity is 1")); } if ( getManyOrderedRequiredInteger().size() < 1 ) { result.add(new UmlgConstraintViolation("multiplicity", "umlgtest::org::umlg::embeddedtest::TestEmbedded::manyOrderedRequiredInteger", "lower multiplicity is 1")); } if ( getGod() == null ) { result.add(new UmlgConstraintViolation("multiplicity", "umlgtest::org::umlg::concretetest::god_testEmbedded_1::god", "lower multiplicity is 1")); } return result; } public List validateName(String name) { List result = new ArrayList(); return result; } @Override public void z_internalAddPersistentValueToCollection(UmlgRuntimeProperty umlgRuntimeProperty, Object umlgNode) { TestEmbeddedRuntimePropertyEnum runtimeProperty; runtimeProperty = (TestEmbeddedRuntimePropertyEnum.fromQualifiedName(umlgRuntimeProperty.getQualifiedName())); if ( runtimeProperty != null ) { switch ( runtimeProperty ) { case manyRequiredOrderedUniqueString: for ( String s : (String[])umlgNode ) { this.manyRequiredOrderedUniqueString.z_internalAdder((String)s); } break; case manyBoolean: for ( boolean s : (boolean[])umlgNode ) { this.manyBoolean.z_internalAdder((boolean)s); } break; case name: this.name.z_internalAdder((String)umlgNode); break; case manyOrderedRequiredInteger: for ( int s : (int[])umlgNode ) { this.manyOrderedRequiredInteger.z_internalAdder((int)s); } break; case god: this.god.z_internalAdder((God)umlgNode); break; case manyOrderedString: for ( String s : (String[])umlgNode ) { this.manyOrderedString.z_internalAdder((String)s); } break; } } } @Override public void z_internalAddToCollection(UmlgRuntimeProperty umlgRuntimeProperty, Object umlgNode) { TestEmbeddedRuntimePropertyEnum runtimeProperty; runtimeProperty = (TestEmbeddedRuntimePropertyEnum.fromQualifiedName(umlgRuntimeProperty.getQualifiedName())); if ( runtimeProperty != null ) { switch ( runtimeProperty ) { case manyRequiredOrderedUniqueString: for ( String s : (String[])umlgNode ) { this.manyRequiredOrderedUniqueString.z_internalAdder(s); } break; case manyBoolean: for ( Boolean s : (Boolean[])umlgNode ) { this.manyBoolean.z_internalAdder(s); } break; case name: this.name.z_internalAdder((String)umlgNode); break; case manyOrderedRequiredInteger: for ( Integer s : (Integer[])umlgNode ) { this.manyOrderedRequiredInteger.z_internalAdder(s); } break; case god: this.god.z_internalAdder((God)umlgNode); break; case manyOrderedString: for ( String s : (String[])umlgNode ) { this.manyOrderedString.z_internalAdder(s); } break; } } } @Override public Set z_internalBooleanProperties() { Set result = new HashSet(); return result; } public void z_internalClearGod() { this.god.z_internalClear(); } public void z_internalClearManyBoolean() { this.manyBoolean.z_internalClear(); } public void z_internalClearManyOrderedRequiredInteger() { this.manyOrderedRequiredInteger.z_internalClear(); } public void z_internalClearManyOrderedString() { this.manyOrderedString.z_internalClear(); } public void z_internalClearManyRequiredOrderedUniqueString() { this.manyRequiredOrderedUniqueString.z_internalClear(); } public void z_internalClearName() { this.name.z_internalClear(); } @Override public Set z_internalDataTypeProperties() { Set result = new HashSet(); result.add(TestEmbeddedRuntimePropertyEnum.manyRequiredOrderedUniqueString); result.add(TestEmbeddedRuntimePropertyEnum.manyBoolean); result.add(TestEmbeddedRuntimePropertyEnum.name); result.add(TestEmbeddedRuntimePropertyEnum.manyOrderedRequiredInteger); result.add(TestEmbeddedRuntimePropertyEnum.manyOrderedString); return result; } @Override public Map z_internalDataTypePropertiesWithDefaultValues() { Map result = new HashMap(); return result; } @Override public UmlgCollection z_internalGetCollectionFor(UmlgRuntimeProperty tumlRuntimeProperty, boolean inverse) { UmlgCollection result = null; if ( result == null ) { TestEmbeddedRuntimePropertyEnum runtimeProperty; if ( !inverse ) { runtimeProperty = (TestEmbeddedRuntimePropertyEnum.fromQualifiedName(tumlRuntimeProperty.getQualifiedName())); } else { runtimeProperty = (TestEmbeddedRuntimePropertyEnum.fromQualifiedName(tumlRuntimeProperty.getInverseQualifiedName())); } if ( runtimeProperty != null ) { switch ( runtimeProperty ) { case manyRequiredOrderedUniqueString: result = this.manyRequiredOrderedUniqueString; break; case manyBoolean: result = this.manyBoolean; break; case name: result = this.name; break; case manyOrderedRequiredInteger: result = this.manyOrderedRequiredInteger; break; case god: result = this.god; break; case manyOrderedString: result = this.manyOrderedString; break; } } } return result; } @Override public UmlgRuntimeProperty z_internalInverseAdder(UmlgRuntimeProperty tumlRuntimeProperty, boolean inverse, UmlgNode umlgNode) { TestEmbeddedRuntimePropertyEnum runtimeProperty; if ( !inverse ) { runtimeProperty = (TestEmbeddedRuntimePropertyEnum.fromQualifiedName(tumlRuntimeProperty.getQualifiedName())); } else { runtimeProperty = (TestEmbeddedRuntimePropertyEnum.fromQualifiedName(tumlRuntimeProperty.getInverseQualifiedName())); } if ( runtimeProperty != null ) { switch ( runtimeProperty ) { case god: this.god.z_internalAdder((God)umlgNode); break; } return runtimeProperty; } else { return null; } } @Override public void z_internalMarkCollectionLoaded(UmlgRuntimeProperty umlgRuntimeProperty, boolean loaded) { TestEmbeddedRuntimePropertyEnum runtimeProperty; runtimeProperty = (TestEmbeddedRuntimePropertyEnum.fromQualifiedName(umlgRuntimeProperty.getQualifiedName())); if ( runtimeProperty != null ) { switch ( runtimeProperty ) { case manyRequiredOrderedUniqueString: this.manyRequiredOrderedUniqueString.setLoaded(loaded); break; case manyBoolean: this.manyBoolean.setLoaded(loaded); break; case name: this.name.setLoaded(loaded); break; case manyOrderedRequiredInteger: this.manyOrderedRequiredInteger.setLoaded(loaded); break; case god: this.god.setLoaded(loaded); break; case manyOrderedString: this.manyOrderedString.setLoaded(loaded); break; } } } static public enum TestEmbeddedRuntimePropertyEnum implements UmlgRuntimeProperty { manyRequiredOrderedUniqueString(/* qualifiedName */ "umlgtest::org::umlg::embeddedtest::TestEmbedded::manyRequiredOrderedUniqueString",/* persistentName */ "manyRequiredOrderedUniqueString",/* inverseName */ "inverseOf::manyRequiredOrderedUniqueString",/* inverseQualifiedName */ "inverseOf::umlgtest::org::umlg::embeddedtest::TestEmbedded::manyRequiredOrderedUniqueString",/* isAssociationClassOne */ false,/* isMemberEndOfAssociationClass */ false,/* associationClassPropertyNameField */ "null",/* inverseAssociationClassPropertyNameField */ "null",/* isAssociationClassProperty */ false,/* isOnePrimitivePropertyOfAssociationClass */ false,/* isOnePrimitive */ false,/* isReadOnly */ false,/* dataTypeEnum */ null,/* validations */ Collections.emptyList(),/* isManyPrimitive */ true,/* oneEnumeration */ false,/* manyEnumeration */ false,/* isControllingSide */ true,/* isComposite */ false,/* isInverseComposite */ false,/* label */ UmlgLabelConverterFactory.getUmlgLabelConverter().convert("manyRequiredOrderedUniqueString"),/* isOneToOne */ false,/* isOneToMany */ false,/* isManyToOne */ false,/* isManyToMany */ true,/* upper */ -1,/* lower */ 1,/* inverseUpper */ 1,/* isQualified */ false,/* isInverseQualified */ false,/* isOrdered */ true,/* isInverseOrdered */ false,/* isUnique */ true,/* isInverseUnique */ false,/* isDerived */ false,/* isNavigable */ true,/* propertyType */ String.class,/* json */ "{\"name\": \"manyRequiredOrderedUniqueString\", \"associationClassOne\": false, \"memberEndOfAssociationClass\": false, \"associationClassPropertyName\": null, \"inverseAssociationClassPropertyName\": null, \"associationClassProperty\": false, \"onePrimitivePropertyOfAssociationClass\": false, \"onePrimitive\": false, \"readOnly\": false, \"dataTypeEnum\": null, \"validations\": null, \"qualifiedName\": \"umlgtest::org::umlg::embeddedtest::TestEmbedded::manyRequiredOrderedUniqueString\", \"persistentName\": \"manyRequiredOrderedUniqueString\", \"inverseName\": \"inverseOf::manyRequiredOrderedUniqueString\", \"inverseQualifiedName\": \"inverseOf::umlgtest::org::umlg::embeddedtest::TestEmbedded::manyRequiredOrderedUniqueString\", \"manyPrimitive\": true, \"oneEnumeration\": false, \"manyEnumeration\": false, \"controllingSide\": true, \"composite\": false, \"inverseComposite\": false, \"oneToOne\": false, \"oneToMany\": false, \"manyToOne\": false, \"manyToMany\": true, \"upper\": -1, \"lower\": 1, \"inverseUpper\": 1, \"label\": \"manyRequiredOrderedUniqueString\", \"qualified\": false, \"inverseQualified\": false, \"ordered\": true, \"inverseOrdered\": false, \"unique\": true, \"inverseUnique\": false, \"derived\": false, \"navigable\": true}",/* isChangeListenerAttribute */ false), manyBoolean(/* qualifiedName */ "umlgtest::org::umlg::embeddedtest::TestEmbedded::manyBoolean",/* persistentName */ "manyBoolean",/* inverseName */ "inverseOf::manyBoolean",/* inverseQualifiedName */ "inverseOf::umlgtest::org::umlg::embeddedtest::TestEmbedded::manyBoolean",/* isAssociationClassOne */ false,/* isMemberEndOfAssociationClass */ false,/* associationClassPropertyNameField */ "null",/* inverseAssociationClassPropertyNameField */ "null",/* isAssociationClassProperty */ false,/* isOnePrimitivePropertyOfAssociationClass */ false,/* isOnePrimitive */ false,/* isReadOnly */ false,/* dataTypeEnum */ null,/* validations */ Collections.emptyList(),/* isManyPrimitive */ true,/* oneEnumeration */ false,/* manyEnumeration */ false,/* isControllingSide */ true,/* isComposite */ false,/* isInverseComposite */ false,/* label */ UmlgLabelConverterFactory.getUmlgLabelConverter().convert("manyBoolean"),/* isOneToOne */ false,/* isOneToMany */ false,/* isManyToOne */ false,/* isManyToMany */ true,/* upper */ -1,/* lower */ 0,/* inverseUpper */ 1,/* isQualified */ false,/* isInverseQualified */ false,/* isOrdered */ false,/* isInverseOrdered */ false,/* isUnique */ false,/* isInverseUnique */ false,/* isDerived */ false,/* isNavigable */ true,/* propertyType */ Boolean.class,/* json */ "{\"name\": \"manyBoolean\", \"associationClassOne\": false, \"memberEndOfAssociationClass\": false, \"associationClassPropertyName\": null, \"inverseAssociationClassPropertyName\": null, \"associationClassProperty\": false, \"onePrimitivePropertyOfAssociationClass\": false, \"onePrimitive\": false, \"readOnly\": false, \"dataTypeEnum\": null, \"validations\": null, \"qualifiedName\": \"umlgtest::org::umlg::embeddedtest::TestEmbedded::manyBoolean\", \"persistentName\": \"manyBoolean\", \"inverseName\": \"inverseOf::manyBoolean\", \"inverseQualifiedName\": \"inverseOf::umlgtest::org::umlg::embeddedtest::TestEmbedded::manyBoolean\", \"manyPrimitive\": true, \"oneEnumeration\": false, \"manyEnumeration\": false, \"controllingSide\": true, \"composite\": false, \"inverseComposite\": false, \"oneToOne\": false, \"oneToMany\": false, \"manyToOne\": false, \"manyToMany\": true, \"upper\": -1, \"lower\": 0, \"inverseUpper\": 1, \"label\": \"manyBoolean\", \"qualified\": false, \"inverseQualified\": false, \"ordered\": false, \"inverseOrdered\": false, \"unique\": false, \"inverseUnique\": false, \"derived\": false, \"navigable\": true}",/* isChangeListenerAttribute */ false), name(/* qualifiedName */ "umlgtest::org::umlg::embeddedtest::TestEmbedded::name",/* persistentName */ "name",/* inverseName */ "inverseOf::name",/* inverseQualifiedName */ "inverseOf::umlgtest::org::umlg::embeddedtest::TestEmbedded::name",/* 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("name"),/* 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 */ String.class,/* json */ "{\"name\": \"name\", \"associationClassOne\": false, \"memberEndOfAssociationClass\": false, \"associationClassPropertyName\": null, \"inverseAssociationClassPropertyName\": null, \"associationClassProperty\": false, \"onePrimitivePropertyOfAssociationClass\": false, \"onePrimitive\": true, \"readOnly\": false, \"dataTypeEnum\": null, \"validations\": null, \"qualifiedName\": \"umlgtest::org::umlg::embeddedtest::TestEmbedded::name\", \"persistentName\": \"name\", \"inverseName\": \"inverseOf::name\", \"inverseQualifiedName\": \"inverseOf::umlgtest::org::umlg::embeddedtest::TestEmbedded::name\", \"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\": \"name\", \"qualified\": false, \"inverseQualified\": false, \"ordered\": false, \"inverseOrdered\": false, \"unique\": true, \"inverseUnique\": false, \"derived\": false, \"navigable\": true}",/* isChangeListenerAttribute */ false), manyOrderedRequiredInteger(/* qualifiedName */ "umlgtest::org::umlg::embeddedtest::TestEmbedded::manyOrderedRequiredInteger",/* persistentName */ "manyOrderedRequiredInteger",/* inverseName */ "inverseOf::manyOrderedRequiredInteger",/* inverseQualifiedName */ "inverseOf::umlgtest::org::umlg::embeddedtest::TestEmbedded::manyOrderedRequiredInteger",/* isAssociationClassOne */ false,/* isMemberEndOfAssociationClass */ false,/* associationClassPropertyNameField */ "null",/* inverseAssociationClassPropertyNameField */ "null",/* isAssociationClassProperty */ false,/* isOnePrimitivePropertyOfAssociationClass */ false,/* isOnePrimitive */ false,/* isReadOnly */ false,/* dataTypeEnum */ null,/* validations */ Collections.emptyList(),/* isManyPrimitive */ true,/* oneEnumeration */ false,/* manyEnumeration */ false,/* isControllingSide */ true,/* isComposite */ false,/* isInverseComposite */ false,/* label */ UmlgLabelConverterFactory.getUmlgLabelConverter().convert("manyOrderedRequiredInteger"),/* isOneToOne */ false,/* isOneToMany */ false,/* isManyToOne */ false,/* isManyToMany */ true,/* upper */ -1,/* lower */ 1,/* inverseUpper */ 1,/* isQualified */ false,/* isInverseQualified */ false,/* isOrdered */ true,/* isInverseOrdered */ false,/* isUnique */ false,/* isInverseUnique */ false,/* isDerived */ false,/* isNavigable */ true,/* propertyType */ Integer.class,/* json */ "{\"name\": \"manyOrderedRequiredInteger\", \"associationClassOne\": false, \"memberEndOfAssociationClass\": false, \"associationClassPropertyName\": null, \"inverseAssociationClassPropertyName\": null, \"associationClassProperty\": false, \"onePrimitivePropertyOfAssociationClass\": false, \"onePrimitive\": false, \"readOnly\": false, \"dataTypeEnum\": null, \"validations\": null, \"qualifiedName\": \"umlgtest::org::umlg::embeddedtest::TestEmbedded::manyOrderedRequiredInteger\", \"persistentName\": \"manyOrderedRequiredInteger\", \"inverseName\": \"inverseOf::manyOrderedRequiredInteger\", \"inverseQualifiedName\": \"inverseOf::umlgtest::org::umlg::embeddedtest::TestEmbedded::manyOrderedRequiredInteger\", \"manyPrimitive\": true, \"oneEnumeration\": false, \"manyEnumeration\": false, \"controllingSide\": true, \"composite\": false, \"inverseComposite\": false, \"oneToOne\": false, \"oneToMany\": false, \"manyToOne\": false, \"manyToMany\": true, \"upper\": -1, \"lower\": 1, \"inverseUpper\": 1, \"label\": \"manyOrderedRequiredInteger\", \"qualified\": false, \"inverseQualified\": false, \"ordered\": true, \"inverseOrdered\": false, \"unique\": false, \"inverseUnique\": false, \"derived\": false, \"navigable\": true}",/* isChangeListenerAttribute */ false), god(/* qualifiedName */ "umlgtest::org::umlg::concretetest::god_testEmbedded_1::god",/* persistentName */ "god",/* inverseName */ "testEmbedded",/* inverseQualifiedName */ "umlgtest::org::umlg::concretetest::God::testEmbedded",/* 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 */ false,/* isComposite */ false,/* isInverseComposite */ true,/* label */ UmlgLabelConverterFactory.getUmlgLabelConverter().convert("god_testEmbedded_1"),/* 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 */ true,/* isDerived */ false,/* isNavigable */ true,/* propertyType */ God.class,/* json */ "{\"name\": \"god\", \"associationClassOne\": false, \"memberEndOfAssociationClass\": false, \"associationClassPropertyName\": null, \"inverseAssociationClassPropertyName\": null, \"associationClassProperty\": false, \"onePrimitivePropertyOfAssociationClass\": false, \"onePrimitive\": false, \"readOnly\": false, \"dataTypeEnum\": null, \"validations\": null, \"qualifiedName\": \"umlgtest::org::umlg::concretetest::god_testEmbedded_1::god\", \"persistentName\": \"god\", \"inverseName\": \"testEmbedded\", \"inverseQualifiedName\": \"umlgtest::org::umlg::concretetest::God::testEmbedded\", \"manyPrimitive\": false, \"oneEnumeration\": false, \"manyEnumeration\": false, \"controllingSide\": false, \"composite\": false, \"inverseComposite\": true, \"oneToOne\": false, \"oneToMany\": false, \"manyToOne\": true, \"manyToMany\": false, \"upper\": 1, \"lower\": 1, \"inverseUpper\": -1, \"label\": \"god_testEmbedded_1\", \"qualified\": false, \"inverseQualified\": false, \"ordered\": false, \"inverseOrdered\": false, \"unique\": true, \"inverseUnique\": true, \"derived\": false, \"navigable\": true}",/* isChangeListenerAttribute */ false), manyOrderedString(/* qualifiedName */ "umlgtest::org::umlg::embeddedtest::TestEmbedded::manyOrderedString",/* persistentName */ "manyOrderedString",/* inverseName */ "inverseOf::manyOrderedString",/* inverseQualifiedName */ "inverseOf::umlgtest::org::umlg::embeddedtest::TestEmbedded::manyOrderedString",/* isAssociationClassOne */ false,/* isMemberEndOfAssociationClass */ false,/* associationClassPropertyNameField */ "null",/* inverseAssociationClassPropertyNameField */ "null",/* isAssociationClassProperty */ false,/* isOnePrimitivePropertyOfAssociationClass */ false,/* isOnePrimitive */ false,/* isReadOnly */ false,/* dataTypeEnum */ null,/* validations */ Collections.emptyList(),/* isManyPrimitive */ true,/* oneEnumeration */ false,/* manyEnumeration */ false,/* isControllingSide */ true,/* isComposite */ false,/* isInverseComposite */ false,/* label */ UmlgLabelConverterFactory.getUmlgLabelConverter().convert("manyOrderedString"),/* isOneToOne */ false,/* isOneToMany */ false,/* isManyToOne */ false,/* isManyToMany */ true,/* upper */ -1,/* lower */ 0,/* inverseUpper */ 1,/* isQualified */ false,/* isInverseQualified */ false,/* isOrdered */ true,/* isInverseOrdered */ false,/* isUnique */ true,/* isInverseUnique */ false,/* isDerived */ false,/* isNavigable */ true,/* propertyType */ String.class,/* json */ "{\"name\": \"manyOrderedString\", \"associationClassOne\": false, \"memberEndOfAssociationClass\": false, \"associationClassPropertyName\": null, \"inverseAssociationClassPropertyName\": null, \"associationClassProperty\": false, \"onePrimitivePropertyOfAssociationClass\": false, \"onePrimitive\": false, \"readOnly\": false, \"dataTypeEnum\": null, \"validations\": null, \"qualifiedName\": \"umlgtest::org::umlg::embeddedtest::TestEmbedded::manyOrderedString\", \"persistentName\": \"manyOrderedString\", \"inverseName\": \"inverseOf::manyOrderedString\", \"inverseQualifiedName\": \"inverseOf::umlgtest::org::umlg::embeddedtest::TestEmbedded::manyOrderedString\", \"manyPrimitive\": true, \"oneEnumeration\": false, \"manyEnumeration\": false, \"controllingSide\": true, \"composite\": false, \"inverseComposite\": false, \"oneToOne\": false, \"oneToMany\": false, \"manyToOne\": false, \"manyToMany\": true, \"upper\": -1, \"lower\": 0, \"inverseUpper\": 1, \"label\": \"manyOrderedString\", \"qualified\": false, \"inverseQualified\": false, \"ordered\": true, \"inverseOrdered\": false, \"unique\": true, \"inverseUnique\": false, \"derived\": false, \"navigable\": true}",/* 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 TestEmbeddedRuntimePropertyEnum * * @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 TestEmbeddedRuntimePropertyEnum(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\": \"TestEmbedded\", "); sb.append("\"qualifiedName\": \"umlgtest::org::umlg::embeddedtest::TestEmbedded\", "); sb.append("\"uri\": \"TODO\", "); sb.append("\"properties\": ["); for ( TestEmbeddedRuntimePropertyEnum l : TestEmbeddedRuntimePropertyEnum.values() ) { sb.append(l.toJson()); if ( count < TestEmbeddedRuntimePropertyEnum.values().length ) { count++; sb.append(","); } } sb.append("]}"); return sb.toString(); } static public TestEmbeddedRuntimePropertyEnum fromInverseQualifiedName(String inverseQualifiedName) { if ( manyOrderedString.getInverseQualifiedName().equals(inverseQualifiedName) ) { return manyOrderedString; } if ( god.getInverseQualifiedName().equals(inverseQualifiedName) ) { return god; } if ( manyOrderedRequiredInteger.getInverseQualifiedName().equals(inverseQualifiedName) ) { return manyOrderedRequiredInteger; } if ( name.getInverseQualifiedName().equals(inverseQualifiedName) ) { return name; } if ( manyBoolean.getInverseQualifiedName().equals(inverseQualifiedName) ) { return manyBoolean; } if ( manyRequiredOrderedUniqueString.getInverseQualifiedName().equals(inverseQualifiedName) ) { return manyRequiredOrderedUniqueString; } return null; } static public TestEmbeddedRuntimePropertyEnum fromLabel(String _label) { if ( manyOrderedString.getLabel().equals(_label) ) { return manyOrderedString; } if ( god.getLabel().equals(_label) ) { return god; } if ( manyOrderedRequiredInteger.getLabel().equals(_label) ) { return manyOrderedRequiredInteger; } if ( name.getLabel().equals(_label) ) { return name; } if ( manyBoolean.getLabel().equals(_label) ) { return manyBoolean; } if ( manyRequiredOrderedUniqueString.getLabel().equals(_label) ) { return manyRequiredOrderedUniqueString; } return null; } static public TestEmbeddedRuntimePropertyEnum fromQualifiedName(String qualifiedName) { if ( manyOrderedString.getQualifiedName().equals(qualifiedName) ) { return manyOrderedString; } if ( god.getQualifiedName().equals(qualifiedName) ) { return god; } if ( manyOrderedRequiredInteger.getQualifiedName().equals(qualifiedName) ) { return manyOrderedRequiredInteger; } if ( name.getQualifiedName().equals(qualifiedName) ) { return name; } if ( manyBoolean.getQualifiedName().equals(qualifiedName) ) { return manyBoolean; } if ( manyRequiredOrderedUniqueString.getQualifiedName().equals(qualifiedName) ) { return manyRequiredOrderedUniqueString; } 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