org.umlg.qualifiertest.QualifierA Maven / Gradle / Ivy
The newest version!
package org.umlg.qualifiertest;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
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.process.traversal.Compare;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
import org.apache.tinkerpop.gremlin.structure.Direction;
import org.apache.tinkerpop.gremlin.structure.Edge;
import org.apache.tinkerpop.gremlin.structure.Element;
import org.apache.tinkerpop.gremlin.structure.T;
import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.umlg.qualifiertest.QualifierA.QualifierARuntimePropertyEnum;
import org.umlg.qualifiertest.QualifierB.QualifierBRuntimePropertyEnum;
import org.umlg.runtime.adaptor.TransactionThreadEntityVar;
import org.umlg.runtime.adaptor.UMLG;
import org.umlg.runtime.adaptor.UmlgLabelConverterFactory;
import org.umlg.runtime.adaptor.UmlgQualifierIdFactory;
import org.umlg.runtime.adaptor.UmlgTmpIdManager;
import org.umlg.runtime.collection.Filter;
import org.umlg.runtime.collection.Multiplicity;
import org.umlg.runtime.collection.Qualifier;
import org.umlg.runtime.collection.UmlgCollection;
import org.umlg.runtime.collection.UmlgQualifiedSet;
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.UmlgQualifiedSetImpl;
import org.umlg.runtime.collection.persistent.UmlgSetClosableIterableImpl;
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.UmlgRootNode;
import org.umlg.runtime.util.ObjectMapperFactory;
import org.umlg.runtime.util.Pair;
import org.umlg.runtime.util.UmlgCollections;
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 QualifierA extends BaseUmlgCompositionNode implements UmlgRootNode, CompositionNode {
static final public long serialVersionUID = 1L;
private UmlgSet name;
private UmlgQualifiedSet qualifierB;
private UmlgQualifiedSet qualifierBInt;
private UmlgQualifiedSet qualifierBMultipleInt;
private String tmpId; // tmpId is only used the umlg restlet gui. It is never persisted. Its value is generated by the gui.
/**
* constructor for QualifierA
*
* @param id
*/
public QualifierA(Object id) {
super(id);
}
/**
* constructor for QualifierA
*
* @param vertex
*/
public QualifierA(Vertex vertex) {
super(vertex);
}
/**
* default constructor for QualifierA
*/
public QualifierA() {
this(true);
}
/**
* constructor for QualifierA
*
* @param persistent
*/
public QualifierA(Boolean persistent) {
super(persistent);
}
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);
}
}
}
public void addToQualifierB(QualifierB qualifierB) {
if ( qualifierB != null ) {
qualifierB.clearQualifierA();
qualifierB.initialiseProperty(QualifierBRuntimePropertyEnum.qualifierA, false, true);
removeFromQualifierB(qualifierB);
}
if ( qualifierB != null ) {
this.qualifierB.add(qualifierB);
}
}
public void addToQualifierB(UmlgSet qualifierB) {
for ( QualifierB _q : qualifierB ) {
this.addToQualifierB(_q);
}
}
public void addToQualifierBIgnoreInverse(QualifierB qualifierB) {
if ( qualifierB != null ) {
qualifierB.clearQualifierA();
qualifierB.initialiseProperty(QualifierBRuntimePropertyEnum.qualifierA, false, true);
removeFromQualifierB(qualifierB);
}
if ( qualifierB != null ) {
this.qualifierB.addIgnoreInverse(qualifierB);
}
}
public void addToQualifierBInt(QualifierB qualifierBInt) {
if ( qualifierBInt != null ) {
qualifierBInt.clearQualifierAInt();
qualifierBInt.initialiseProperty(QualifierBRuntimePropertyEnum.qualifierAInt, false, true);
removeFromQualifierBInt(qualifierBInt);
}
if ( qualifierBInt != null ) {
this.qualifierBInt.add(qualifierBInt);
}
}
public void addToQualifierBInt(UmlgSet qualifierBInt) {
for ( QualifierB _q : qualifierBInt ) {
this.addToQualifierBInt(_q);
}
}
public void addToQualifierBIntIgnoreInverse(QualifierB qualifierBInt) {
if ( qualifierBInt != null ) {
qualifierBInt.clearQualifierAInt();
qualifierBInt.initialiseProperty(QualifierBRuntimePropertyEnum.qualifierAInt, false, true);
removeFromQualifierBInt(qualifierBInt);
}
if ( qualifierBInt != null ) {
this.qualifierBInt.addIgnoreInverse(qualifierBInt);
}
}
public void addToQualifierBMultipleInt(QualifierB qualifierBMultipleInt) {
if ( qualifierBMultipleInt != null ) {
qualifierBMultipleInt.clearQualifierAMultipleInt();
qualifierBMultipleInt.initialiseProperty(QualifierBRuntimePropertyEnum.qualifierAMultipleInt, false, true);
removeFromQualifierBMultipleInt(qualifierBMultipleInt);
}
if ( qualifierBMultipleInt != null ) {
this.qualifierBMultipleInt.add(qualifierBMultipleInt);
}
}
public void addToQualifierBMultipleInt(UmlgSet qualifierBMultipleInt) {
for ( QualifierB _q : qualifierBMultipleInt ) {
this.addToQualifierBMultipleInt(_q);
}
}
public void addToQualifierBMultipleIntIgnoreInverse(QualifierB qualifierBMultipleInt) {
if ( qualifierBMultipleInt != null ) {
qualifierBMultipleInt.clearQualifierAMultipleInt();
qualifierBMultipleInt.initialiseProperty(QualifierBRuntimePropertyEnum.qualifierAMultipleInt, false, true);
removeFromQualifierBMultipleInt(qualifierBMultipleInt);
}
if ( qualifierBMultipleInt != null ) {
this.qualifierBMultipleInt.addIgnoreInverse(qualifierBMultipleInt);
}
}
static public UmlgSet extends QualifierA> allInstances(Filter filter) {
UmlgSet result = new UmlgMemorySet();
result.addAll(UMLG.get().allInstances(QualifierA.class.getName(), filter));
return result;
}
static public UmlgSet extends QualifierA> allInstances() {
UmlgSet result = new UmlgMemorySet();
result.addAll(UMLG.get().allInstances(QualifierA.class.getName()));
return result;
}
@Override
public List checkClassConstraints() {
List result = new ArrayList();
return result;
}
public void clearName() {
this.name.clear();
}
public void clearQualifierB() {
this.qualifierB.clear();
}
public void clearQualifierBInt() {
this.qualifierBInt.clear();
}
public void clearQualifierBMultipleInt() {
this.qualifierBMultipleInt.clear();
}
@Override
public void delete() {
this.qualifierBMultipleInt.clear();
this.qualifierBInt.clear();
this.qualifierB.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("name") ) {
if ( propertyMap.get("name") != null ) {
String name = (String)propertyMap.get("name");
setName(name);
} else {
setName(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) {
}
@Override
public String getMetaDataAsJson() {
return QualifierA.QualifierARuntimePropertyEnum.asJson();
}
public String getName() {
UmlgSet tmp = this.name;
if ( !tmp.isEmpty() ) {
return tmp.iterator().next();
} else {
return null;
}
}
@Override
public UmlgNode getOwningObject() {
return null;
}
@Override
public String getQualifiedName() {
return "umlgtest::org::umlg::qualifiertest::QualifierA";
}
public UmlgQualifiedSet getQualifierB() {
return this.qualifierB;
}
public QualifierB getQualifierBForName1QualifierandName2Qualifier(Pair name1Qualifier, Pair name2Qualifier) {
GraphTraversal graphTraversalqualifierB_QualifierB = UMLG.get().traversal().V(this.vertex).to(
QualifierARuntimePropertyEnum.qualifierB.isControllingSide() ? Direction.OUT : Direction.IN,
QualifierARuntimePropertyEnum.qualifierB.getLabel())
.has(T.label, "QualifierB");
UmlgSet result;
graphTraversalqualifierB_QualifierB.has("name1", name1Qualifier.getSecond());
graphTraversalqualifierB_QualifierB.has("name2", name2Qualifier.getSecond());
UmlgSet qualifierB_qualifierB_QualifierB = new UmlgSetClosableIterableImpl(graphTraversalqualifierB_QualifierB, QualifierARuntimePropertyEnum.qualifierB);
result = qualifierB_qualifierB_QualifierB;
if ( result.iterator().hasNext() ) {
return result.iterator().next();
} else {
return null;
}
}
public UmlgSet getQualifierBForPartialName1QualifierandName2Qualifier(Pair name1Qualifier, Pair name2Qualifier) {
GraphTraversal graphTraversal = UMLG.get().traversal().V(this.vertex).to(
QualifierARuntimePropertyEnum.qualifierB.isControllingSide() ? Direction.OUT : Direction.IN,
QualifierARuntimePropertyEnum.qualifierB.getLabel())
.has(T.label, "QualifierB");
if ( name1Qualifier != null ) {
graphTraversal.has("name1", name1Qualifier.getSecond());
}
if ( name2Qualifier != null ) {
graphTraversal.has("name2", name2Qualifier.getSecond());
}
if ( graphTraversal.hasNext() ) {
return new UmlgSetClosableIterableImpl(graphTraversal, QualifierARuntimePropertyEnum.qualifierB);
} else {
return UmlgCollections.emptySet();
}
}
public UmlgQualifiedSet getQualifierBInt() {
return this.qualifierBInt;
}
public QualifierB getQualifierBIntForQualifierInt1(Pair qualifierInt1) {
GraphTraversal graphTraversalqualifierBInt_QualifierB = UMLG.get().traversal().V(this.vertex).to(
QualifierARuntimePropertyEnum.qualifierBInt.isControllingSide() ? Direction.OUT : Direction.IN,
QualifierARuntimePropertyEnum.qualifierBInt.getLabel())
.has(T.label, "QualifierB");
UmlgSet result;
graphTraversalqualifierBInt_QualifierB.has("int1", qualifierInt1.getSecond());
UmlgSet qualifierBInt_qualifierBInt_QualifierB = new UmlgSetClosableIterableImpl(graphTraversalqualifierBInt_QualifierB, QualifierARuntimePropertyEnum.qualifierBInt);
result = qualifierBInt_qualifierBInt_QualifierB;
if ( result.iterator().hasNext() ) {
return result.iterator().next();
} else {
return null;
}
}
public UmlgQualifiedSet getQualifierBMultipleInt() {
return this.qualifierBMultipleInt;
}
public UmlgSet getQualifierBMultipleIntForPartialQualifierInt2andQualifierInt3(Pair qualifierInt2, Pair qualifierInt3) {
GraphTraversal graphTraversal = UMLG.get().traversal().V(this.vertex).to(
QualifierARuntimePropertyEnum.qualifierBMultipleInt.isControllingSide() ? Direction.OUT : Direction.IN,
QualifierARuntimePropertyEnum.qualifierBMultipleInt.getLabel())
.has(T.label, "QualifierB");
if ( qualifierInt2 != null ) {
graphTraversal.has("int2", qualifierInt2.getSecond());
}
if ( qualifierInt3 != null ) {
graphTraversal.has("int3", qualifierInt3.getSecond());
}
if ( graphTraversal.hasNext() ) {
return new UmlgSetClosableIterableImpl(graphTraversal, QualifierARuntimePropertyEnum.qualifierBMultipleInt);
} else {
return UmlgCollections.emptySet();
}
}
public QualifierB getQualifierBMultipleIntForQualifierInt2andQualifierInt3(Pair qualifierInt2, Pair qualifierInt3) {
GraphTraversal graphTraversalqualifierBMultipleInt_QualifierB = UMLG.get().traversal().V(this.vertex).to(
QualifierARuntimePropertyEnum.qualifierBMultipleInt.isControllingSide() ? Direction.OUT : Direction.IN,
QualifierARuntimePropertyEnum.qualifierBMultipleInt.getLabel())
.has(T.label, "QualifierB");
UmlgSet result;
graphTraversalqualifierBMultipleInt_QualifierB.has("int2", qualifierInt2.getSecond());
graphTraversalqualifierBMultipleInt_QualifierB.has("int3", qualifierInt3.getSecond());
UmlgSet qualifierBMultipleInt_qualifierBMultipleInt_QualifierB = new UmlgSetClosableIterableImpl(graphTraversalqualifierBMultipleInt_QualifierB, QualifierARuntimePropertyEnum.qualifierBMultipleInt);
result = qualifierBMultipleInt_qualifierBMultipleInt_QualifierB;
if ( result.iterator().hasNext() ) {
return result.iterator().next();
} else {
return null;
}
}
public List getQualifierForQualifierB(QualifierB context) {
List result = new ArrayList<>();
result.add(new Qualifier("name1", context.getName1(), Multiplicity.ZERO_TO_ONE, QualifierB.QualifierBRuntimePropertyEnum.name1));
result.add(new Qualifier("name2", context.getName2(), Multiplicity.ZERO_TO_ONE, QualifierB.QualifierBRuntimePropertyEnum.name2));
return result;
}
public List getQualifierForQualifierBInt(QualifierB context) {
List result = new ArrayList<>();
result.add(new Qualifier("int1", context.getInt1(), Multiplicity.ZERO_TO_ONE, QualifierB.QualifierBRuntimePropertyEnum.int1));
return result;
}
public List getQualifierForQualifierBMultipleInt(QualifierB context) {
List result = new ArrayList<>();
result.add(new Qualifier("int2", context.getInt2(), Multiplicity.ZERO_TO_ONE, QualifierB.QualifierBRuntimePropertyEnum.int2));
result.add(new Qualifier("int3", context.getInt3(), Multiplicity.ZERO_TO_ONE, QualifierB.QualifierBRuntimePropertyEnum.int3));
return result;
}
/**
* 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();
QualifierARuntimePropertyEnum runtimeProperty;
if ( !inverse ) {
runtimeProperty = QualifierARuntimePropertyEnum.fromQualifiedName(tumlRuntimeProperty.getQualifiedName());
} else {
runtimeProperty = QualifierARuntimePropertyEnum.fromQualifiedName(tumlRuntimeProperty.getInverseQualifiedName());
}
if ( runtimeProperty != null && result.isEmpty() ) {
switch ( runtimeProperty ) {
case qualifierBMultipleInt:
result = getQualifierForQualifierBMultipleInt((QualifierB)node);
break;
case qualifierBInt:
result = getQualifierForQualifierBInt((QualifierB)node);
break;
case qualifierB:
result = getQualifierForQualifierB((QualifierB)node);
break;
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;
QualifierARuntimePropertyEnum runtimeProperty;
if ( !inverse ) {
runtimeProperty = QualifierARuntimePropertyEnum.fromQualifiedName(tumlRuntimeProperty.getQualifiedName());
} else {
runtimeProperty = QualifierARuntimePropertyEnum.fromQualifiedName(tumlRuntimeProperty.getInverseQualifiedName());
}
if ( runtimeProperty != null && result == 0 ) {
switch ( runtimeProperty ) {
case name:
result = name.size();
break;
case qualifierBMultipleInt:
result = qualifierBMultipleInt.size();
break;
case qualifierBInt:
result = qualifierBInt.size();
break;
case qualifierB:
result = qualifierB.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.name = new UmlgSetImpl(this, PropertyTree.from(QualifierARuntimePropertyEnum.name), loaded);
this.qualifierBMultipleInt = new UmlgQualifiedSetImpl(this, PropertyTree.from(QualifierARuntimePropertyEnum.qualifierBMultipleInt), loaded);
this.qualifierBInt = new UmlgQualifiedSetImpl(this, PropertyTree.from(QualifierARuntimePropertyEnum.qualifierBInt), loaded);
this.qualifierB = new UmlgQualifiedSetImpl(this, PropertyTree.from(QualifierARuntimePropertyEnum.qualifierB), loaded);
}
@Override
public void initialiseProperty(UmlgRuntimeProperty tumlRuntimeProperty, boolean inverse, boolean loaded) {
QualifierARuntimePropertyEnum runtimeProperty;
if ( !inverse ) {
runtimeProperty = (QualifierARuntimePropertyEnum.fromQualifiedName(tumlRuntimeProperty.getQualifiedName()));
} else {
runtimeProperty = (QualifierARuntimePropertyEnum.fromQualifiedName(tumlRuntimeProperty.getInverseQualifiedName()));
}
if ( runtimeProperty != null ) {
switch ( runtimeProperty ) {
case name:
this.name = new UmlgSetImpl(this, PropertyTree.from(QualifierARuntimePropertyEnum.name), loaded);
break;
case qualifierBMultipleInt:
this.qualifierBMultipleInt = new UmlgQualifiedSetImpl(this, PropertyTree.from(QualifierARuntimePropertyEnum.qualifierBMultipleInt), loaded);
break;
case qualifierBInt:
this.qualifierBInt = new UmlgQualifiedSetImpl(this, PropertyTree.from(QualifierARuntimePropertyEnum.qualifierBInt), loaded);
break;
case qualifierB:
this.qualifierB = new UmlgQualifiedSetImpl(this, PropertyTree.from(QualifierARuntimePropertyEnum.qualifierB), loaded);
break;
}
}
}
@Override
public UmlgRuntimeProperty inverseAdder(UmlgRuntimeProperty tumlRuntimeProperty, boolean inverse, UmlgNode umlgNode) {
QualifierARuntimePropertyEnum runtimeProperty;
if ( !inverse ) {
runtimeProperty = (QualifierARuntimePropertyEnum.fromQualifiedName(tumlRuntimeProperty.getQualifiedName()));
} else {
runtimeProperty = (QualifierARuntimePropertyEnum.fromQualifiedName(tumlRuntimeProperty.getInverseQualifiedName()));
}
if ( runtimeProperty != null ) {
switch ( runtimeProperty ) {
case qualifierBMultipleInt:
this.qualifierBMultipleInt.inverseAdder((QualifierB)umlgNode);
break;
case qualifierBInt:
this.qualifierBInt.inverseAdder((QualifierB)umlgNode);
break;
case qualifierB:
this.qualifierB.inverseAdder((QualifierB)umlgNode);
break;
}
return runtimeProperty;
} else {
return null;
}
}
@Override
public boolean isTinkerRoot() {
return true;
}
public UmlgSet lookupFor_qualifierAInt_qualifierBInt() {
UmlgSet result = new UmlgMemorySet();
Filter filter = new Filter() {
@Override
public boolean filter(QualifierB entity){
return entity.getQualifierAInt() == null;
}
};
result.addAll(org.umlg.qualifiertest.QualifierB.allInstances(filter));
return result;
}
public UmlgSet lookupFor_qualifierAMultipleInt_qualifierBMultipleInt() {
UmlgSet result = new UmlgMemorySet();
Filter filter = new Filter() {
@Override
public boolean filter(QualifierB entity){
return entity.getQualifierAMultipleInt() == null;
}
};
result.addAll(org.umlg.qualifiertest.QualifierB.allInstances(filter));
return result;
}
public UmlgSet lookupFor_qualifierA_qualifierB() {
UmlgSet result = new UmlgMemorySet();
Filter filter = new Filter() {
@Override
public boolean filter(QualifierB entity){
return entity.getQualifierA() == null;
}
};
result.addAll(org.umlg.qualifiertest.QualifierB.allInstances(filter));
return result;
}
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 removeFromQualifierB(QualifierB qualifierB) {
if ( qualifierB != null ) {
this.qualifierB.remove(qualifierB);
}
}
public void removeFromQualifierB(UmlgSet qualifierB) {
if ( !qualifierB.isEmpty() ) {
this.qualifierB.removeAll(qualifierB);
}
}
public void removeFromQualifierBInt(QualifierB qualifierBInt) {
if ( qualifierBInt != null ) {
this.qualifierBInt.remove(qualifierBInt);
}
}
public void removeFromQualifierBInt(UmlgSet qualifierBInt) {
if ( !qualifierBInt.isEmpty() ) {
this.qualifierBInt.removeAll(qualifierBInt);
}
}
public void removeFromQualifierBMultipleInt(QualifierB qualifierBMultipleInt) {
if ( qualifierBMultipleInt != null ) {
this.qualifierBMultipleInt.remove(qualifierBMultipleInt);
}
}
public void removeFromQualifierBMultipleInt(UmlgSet qualifierBMultipleInt) {
if ( !qualifierBMultipleInt.isEmpty() ) {
this.qualifierBMultipleInt.removeAll(qualifierBMultipleInt);
}
}
public void setName(String name) {
if ( name == null ) {
clearName();
} else {
z_internalClearName();
}
addToName(name);
}
public void setQualifierB(UmlgSet qualifierB) {
clearQualifierB();
if ( qualifierB != null ) {
addToQualifierB(qualifierB);
}
}
public void setQualifierBInt(UmlgSet qualifierBInt) {
clearQualifierBInt();
if ( qualifierBInt != null ) {
addToQualifierBInt(qualifierBInt);
}
}
public void setQualifierBMultipleInt(UmlgSet qualifierBMultipleInt) {
clearQualifierBMultipleInt();
if ( qualifierBMultipleInt != null ) {
addToQualifierBMultipleInt(qualifierBMultipleInt);
}
}
/**
* 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("\"name\": " + (getName() != null ? "\"" + StringEscapeUtils.escapeJson(getName()) + "\"" : null ));
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("\"name\": " + (getName() != null ? "\"" + StringEscapeUtils.escapeJson(getName()) + "\"" : null ));
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);
}
@Override
public List validateMultiplicities() {
List result = new ArrayList();
if ( getName() == null ) {
result.add(new UmlgConstraintViolation("multiplicity", "umlgtest::org::umlg::qualifiertest::QualifierA::name", "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) {
QualifierARuntimePropertyEnum runtimeProperty;
runtimeProperty = (QualifierARuntimePropertyEnum.fromQualifiedName(umlgRuntimeProperty.getQualifiedName()));
if ( runtimeProperty != null ) {
switch ( runtimeProperty ) {
case name:
this.name.z_internalAdder((String)umlgNode);
break;
case qualifierBMultipleInt:
this.qualifierBMultipleInt.z_internalAdder((QualifierB)umlgNode);
break;
case qualifierBInt:
this.qualifierBInt.z_internalAdder((QualifierB)umlgNode);
break;
case qualifierB:
this.qualifierB.z_internalAdder((QualifierB)umlgNode);
break;
}
}
}
@Override
public void z_internalAddToCollection(UmlgRuntimeProperty umlgRuntimeProperty, Object umlgNode) {
QualifierARuntimePropertyEnum runtimeProperty;
runtimeProperty = (QualifierARuntimePropertyEnum.fromQualifiedName(umlgRuntimeProperty.getQualifiedName()));
if ( runtimeProperty != null ) {
switch ( runtimeProperty ) {
case name:
this.name.z_internalAdder((String)umlgNode);
break;
case qualifierBMultipleInt:
this.qualifierBMultipleInt.z_internalAdder((QualifierB)umlgNode);
break;
case qualifierBInt:
this.qualifierBInt.z_internalAdder((QualifierB)umlgNode);
break;
case qualifierB:
this.qualifierB.z_internalAdder((QualifierB)umlgNode);
break;
}
}
}
@Override
public Set z_internalBooleanProperties() {
Set result = new HashSet();
return result;
}
public void z_internalClearName() {
this.name.z_internalClear();
}
public void z_internalClearQualifierB() {
this.qualifierB.z_internalClear();
}
public void z_internalClearQualifierBInt() {
this.qualifierBInt.z_internalClear();
}
public void z_internalClearQualifierBMultipleInt() {
this.qualifierBMultipleInt.z_internalClear();
}
@Override
public Set z_internalDataTypeProperties() {
Set result = new HashSet();
result.add(QualifierARuntimePropertyEnum.name);
return result;
}
@Override
public Map z_internalDataTypePropertiesWithDefaultValues() {
Map result = new HashMap();
return result;
}
@Override
public UmlgCollection extends Object> z_internalGetCollectionFor(UmlgRuntimeProperty tumlRuntimeProperty, boolean inverse) {
UmlgCollection extends Object> result = null;
if ( result == null ) {
QualifierARuntimePropertyEnum runtimeProperty;
if ( !inverse ) {
runtimeProperty = (QualifierARuntimePropertyEnum.fromQualifiedName(tumlRuntimeProperty.getQualifiedName()));
} else {
runtimeProperty = (QualifierARuntimePropertyEnum.fromQualifiedName(tumlRuntimeProperty.getInverseQualifiedName()));
}
if ( runtimeProperty != null ) {
switch ( runtimeProperty ) {
case name:
result = this.name;
break;
case qualifierBMultipleInt:
result = this.qualifierBMultipleInt;
break;
case qualifierBInt:
result = this.qualifierBInt;
break;
case qualifierB:
result = this.qualifierB;
break;
}
}
}
return result;
}
@Override
public UmlgRuntimeProperty z_internalInverseAdder(UmlgRuntimeProperty tumlRuntimeProperty, boolean inverse, UmlgNode umlgNode) {
QualifierARuntimePropertyEnum runtimeProperty;
if ( !inverse ) {
runtimeProperty = (QualifierARuntimePropertyEnum.fromQualifiedName(tumlRuntimeProperty.getQualifiedName()));
} else {
runtimeProperty = (QualifierARuntimePropertyEnum.fromQualifiedName(tumlRuntimeProperty.getInverseQualifiedName()));
}
if ( runtimeProperty != null ) {
switch ( runtimeProperty ) {
case qualifierBMultipleInt:
this.qualifierBMultipleInt.z_internalAdder((QualifierB)umlgNode);
break;
case qualifierBInt:
this.qualifierBInt.z_internalAdder((QualifierB)umlgNode);
break;
case qualifierB:
this.qualifierB.z_internalAdder((QualifierB)umlgNode);
break;
}
return runtimeProperty;
} else {
return null;
}
}
@Override
public void z_internalMarkCollectionLoaded(UmlgRuntimeProperty umlgRuntimeProperty, boolean loaded) {
QualifierARuntimePropertyEnum runtimeProperty;
runtimeProperty = (QualifierARuntimePropertyEnum.fromQualifiedName(umlgRuntimeProperty.getQualifiedName()));
if ( runtimeProperty != null ) {
switch ( runtimeProperty ) {
case name:
this.name.setLoaded(loaded);
break;
case qualifierBMultipleInt:
this.qualifierBMultipleInt.setLoaded(loaded);
break;
case qualifierBInt:
this.qualifierBInt.setLoaded(loaded);
break;
case qualifierB:
this.qualifierB.setLoaded(loaded);
break;
}
}
}
static public enum QualifierARuntimePropertyEnum implements UmlgRuntimeProperty {
name(/* qualifiedName */ "umlgtest::org::umlg::qualifiertest::QualifierA::name",/* persistentName */ "name",/* inverseName */ "inverseOf::name",/* inverseQualifiedName */ "inverseOf::umlgtest::org::umlg::qualifiertest::QualifierA::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::qualifiertest::QualifierA::name\", \"persistentName\": \"name\", \"inverseName\": \"inverseOf::name\", \"inverseQualifiedName\": \"inverseOf::umlgtest::org::umlg::qualifiertest::QualifierA::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),
qualifierBMultipleInt(/* qualifiedName */ "umlgtest::org::umlg::qualifiertest::QualifierA::qualifierBMultipleInt",/* persistentName */ "qualifierBMultipleInt",/* inverseName */ "qualifierAMultipleInt",/* inverseQualifiedName */ "umlgtest::org::umlg::qualifiertest::A_qualifierA_qualifierB_3::qualifierAMultipleInt",/* 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("A_qualifierA_qualifierB_3"),/* isOneToOne */ false,/* isOneToMany */ true,/* isManyToOne */ false,/* isManyToMany */ false,/* upper */ 1,/* lower */ 0,/* inverseUpper */ 1,/* isQualified */ true,/* isInverseQualified */ false,/* isOrdered */ false,/* isInverseOrdered */ false,/* isUnique */ true,/* isInverseUnique */ true,/* isDerived */ false,/* isNavigable */ true,/* propertyType */ QualifierB.class,/* json */ "{\"name\": \"qualifierBMultipleInt\", \"associationClassOne\": false, \"memberEndOfAssociationClass\": false, \"associationClassPropertyName\": null, \"inverseAssociationClassPropertyName\": null, \"associationClassProperty\": false, \"onePrimitivePropertyOfAssociationClass\": false, \"onePrimitive\": false, \"readOnly\": false, \"dataTypeEnum\": null, \"validations\": null, \"qualifiedName\": \"umlgtest::org::umlg::qualifiertest::QualifierA::qualifierBMultipleInt\", \"persistentName\": \"qualifierBMultipleInt\", \"inverseName\": \"qualifierAMultipleInt\", \"inverseQualifiedName\": \"umlgtest::org::umlg::qualifiertest::A_qualifierA_qualifierB_3::qualifierAMultipleInt\", \"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\": \"A_qualifierA_qualifierB_3\", \"qualified\": true, \"inverseQualified\": false, \"ordered\": false, \"inverseOrdered\": false, \"unique\": true, \"inverseUnique\": true, \"derived\": false, \"navigable\": true}",/* isChangeListenerAttribute */ false),
qualifierBInt(/* qualifiedName */ "umlgtest::org::umlg::qualifiertest::QualifierA::qualifierBInt",/* persistentName */ "qualifierBInt",/* inverseName */ "qualifierAInt",/* inverseQualifiedName */ "umlgtest::org::umlg::qualifiertest::A_qualifierA_qualifierB_2::qualifierAInt",/* 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("A_qualifierA_qualifierB_2"),/* isOneToOne */ false,/* isOneToMany */ true,/* isManyToOne */ false,/* isManyToMany */ false,/* upper */ 1,/* lower */ 0,/* inverseUpper */ 1,/* isQualified */ true,/* isInverseQualified */ false,/* isOrdered */ false,/* isInverseOrdered */ false,/* isUnique */ true,/* isInverseUnique */ true,/* isDerived */ false,/* isNavigable */ true,/* propertyType */ QualifierB.class,/* json */ "{\"name\": \"qualifierBInt\", \"associationClassOne\": false, \"memberEndOfAssociationClass\": false, \"associationClassPropertyName\": null, \"inverseAssociationClassPropertyName\": null, \"associationClassProperty\": false, \"onePrimitivePropertyOfAssociationClass\": false, \"onePrimitive\": false, \"readOnly\": false, \"dataTypeEnum\": null, \"validations\": null, \"qualifiedName\": \"umlgtest::org::umlg::qualifiertest::QualifierA::qualifierBInt\", \"persistentName\": \"qualifierBInt\", \"inverseName\": \"qualifierAInt\", \"inverseQualifiedName\": \"umlgtest::org::umlg::qualifiertest::A_qualifierA_qualifierB_2::qualifierAInt\", \"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\": \"A_qualifierA_qualifierB_2\", \"qualified\": true, \"inverseQualified\": false, \"ordered\": false, \"inverseOrdered\": false, \"unique\": true, \"inverseUnique\": true, \"derived\": false, \"navigable\": true}",/* isChangeListenerAttribute */ false),
qualifierB(/* qualifiedName */ "umlgtest::org::umlg::qualifiertest::QualifierA::qualifierB",/* persistentName */ "qualifierB",/* inverseName */ "qualifierA",/* inverseQualifiedName */ "umlgtest::org::umlg::qualifiertest::A_qualifierA_qualifierB_1::qualifierA",/* 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("A_qualifierA_qualifierB_1"),/* isOneToOne */ false,/* isOneToMany */ true,/* isManyToOne */ false,/* isManyToMany */ false,/* upper */ 1,/* lower */ 0,/* inverseUpper */ 1,/* isQualified */ true,/* isInverseQualified */ false,/* isOrdered */ false,/* isInverseOrdered */ false,/* isUnique */ true,/* isInverseUnique */ true,/* isDerived */ false,/* isNavigable */ true,/* propertyType */ QualifierB.class,/* json */ "{\"name\": \"qualifierB\", \"associationClassOne\": false, \"memberEndOfAssociationClass\": false, \"associationClassPropertyName\": null, \"inverseAssociationClassPropertyName\": null, \"associationClassProperty\": false, \"onePrimitivePropertyOfAssociationClass\": false, \"onePrimitive\": false, \"readOnly\": false, \"dataTypeEnum\": null, \"validations\": null, \"qualifiedName\": \"umlgtest::org::umlg::qualifiertest::QualifierA::qualifierB\", \"persistentName\": \"qualifierB\", \"inverseName\": \"qualifierA\", \"inverseQualifiedName\": \"umlgtest::org::umlg::qualifiertest::A_qualifierA_qualifierB_1::qualifierA\", \"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\": \"A_qualifierA_qualifierB_1\", \"qualified\": true, \"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("rootQualifierA"),/* 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\": \"rootQualifierA\", \"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 QualifierARuntimePropertyEnum
*
* @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 QualifierARuntimePropertyEnum(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\": \"QualifierA\", ");
sb.append("\"qualifiedName\": \"umlgtest::org::umlg::qualifiertest::QualifierA\", ");
sb.append("\"uri\": \"TODO\", ");
sb.append("\"properties\": [");
for ( QualifierARuntimePropertyEnum l : QualifierARuntimePropertyEnum.values() ) {
sb.append(l.toJson());
if ( count < QualifierARuntimePropertyEnum.values().length ) {
count++;
sb.append(",");
}
}
sb.append("]}");
return sb.toString();
}
static public QualifierARuntimePropertyEnum fromInverseQualifiedName(String inverseQualifiedName) {
if ( umlgtest.getInverseQualifiedName().equals(inverseQualifiedName) ) {
return umlgtest;
}
if ( qualifierB.getInverseQualifiedName().equals(inverseQualifiedName) ) {
return qualifierB;
}
if ( qualifierBInt.getInverseQualifiedName().equals(inverseQualifiedName) ) {
return qualifierBInt;
}
if ( qualifierBMultipleInt.getInverseQualifiedName().equals(inverseQualifiedName) ) {
return qualifierBMultipleInt;
}
if ( name.getInverseQualifiedName().equals(inverseQualifiedName) ) {
return name;
}
return null;
}
static public QualifierARuntimePropertyEnum fromLabel(String _label) {
if ( umlgtest.getLabel().equals(_label) ) {
return umlgtest;
}
if ( qualifierB.getLabel().equals(_label) ) {
return qualifierB;
}
if ( qualifierBInt.getLabel().equals(_label) ) {
return qualifierBInt;
}
if ( qualifierBMultipleInt.getLabel().equals(_label) ) {
return qualifierBMultipleInt;
}
if ( name.getLabel().equals(_label) ) {
return name;
}
return null;
}
static public QualifierARuntimePropertyEnum fromQualifiedName(String qualifiedName) {
if ( umlgtest.getQualifiedName().equals(qualifiedName) ) {
return umlgtest;
}
if ( qualifierB.getQualifiedName().equals(qualifiedName) ) {
return qualifierB;
}
if ( qualifierBInt.getQualifiedName().equals(qualifiedName) ) {
return qualifierBInt;
}
if ( qualifierBMultipleInt.getQualifiedName().equals(qualifiedName) ) {
return qualifierBMultipleInt;
}
if ( name.getQualifiedName().equals(qualifiedName) ) {
return name;
}
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