org.umlg.BaseModelUmlg Maven / Gradle / Ivy
The newest version!
package org.umlg;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Arrays;
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.collectiontest.Dream;
import org.umlg.collectiontest.Fantasy;
import org.umlg.collectiontest.Finger;
import org.umlg.collectiontest.Foot;
import org.umlg.collectiontest.Hand;
import org.umlg.collectiontest.Nightmare;
import org.umlg.collectiontest.World;
import org.umlg.componenttest.Space;
import org.umlg.componenttest.SpaceTime;
import org.umlg.componenttest.Time;
import org.umlg.componenttest.ValidationTest;
import org.umlg.concretetest.Angel;
import org.umlg.concretetest.Demon;
import org.umlg.concretetest.God;
import org.umlg.concretetest.Universe;
import org.umlg.hierarchytest.FakeRootFolder;
import org.umlg.hierarchytest.Folder;
import org.umlg.hierarchytest.RealRootFolder;
import org.umlg.inheritencetest.Biped;
import org.umlg.inheritencetest.Mamal;
import org.umlg.inheritencetest.Quadped;
import org.umlg.interfacetest.Creature;
import org.umlg.interfacetest.ManyA;
import org.umlg.interfacetest.ManyB;
import org.umlg.interfacetest.Phantom;
import org.umlg.interfacetest.SpecialCreature;
import org.umlg.interfacetest.Spook;
import org.umlg.lookup.Devil1;
import org.umlg.lookup.Devil2;
import org.umlg.lookup.Devil3;
import org.umlg.lookup.Level1;
import org.umlg.lookup.Level2;
import org.umlg.lookup.Level3;
import org.umlg.lookup.Nevil1;
import org.umlg.lookup.Nevil2;
import org.umlg.lookup.Nevil3;
import org.umlg.meta.BaseClassUmlg;
import org.umlg.meta.ClassQuery;
import org.umlg.meta.RootQuery;
import org.umlg.navigability.NonNavigableMany;
import org.umlg.navigability.NonNavigableOne;
import org.umlg.onetoone.OneOne;
import org.umlg.onetoone.OneTwo;
import org.umlg.qualifiertest.Nature;
import org.umlg.runtime.adaptor.TransactionThreadEntityVar;
import org.umlg.runtime.adaptor.UMLG;
import org.umlg.runtime.adaptor.UmlgLabelConverterFactory;
import org.umlg.runtime.adaptor.UmlgTmpIdManager;
import org.umlg.runtime.collection.Filter;
import org.umlg.runtime.collection.Qualifier;
import org.umlg.runtime.collection.UmlgCollection;
import org.umlg.runtime.collection.UmlgRuntimeProperty;
import org.umlg.runtime.collection.UmlgSet;
import org.umlg.runtime.collection.memory.UmlgMemorySet;
import org.umlg.runtime.collection.persistent.PropertyTree;
import org.umlg.runtime.collection.persistent.UmlgSetImpl;
import org.umlg.runtime.domain.BaseUmlgCompositionNode;
import org.umlg.runtime.domain.CompositionNode;
import org.umlg.runtime.domain.DataTypeEnum;
import org.umlg.runtime.domain.UmlgNode;
import org.umlg.runtime.util.ObjectMapperFactory;
import org.umlg.runtime.util.UmlgFormatter;
import org.umlg.runtime.validation.DateTimeValidation;
import org.umlg.runtime.validation.UmlgConstraintViolation;
import org.umlg.runtime.validation.UmlgConstraintViolationException;
import org.umlg.runtime.validation.UmlgValidation;
import org.umlg.tag.Tag;
abstract public class BaseModelUmlg extends BaseUmlgCompositionNode implements CompositionNode {
static final public long serialVersionUID = 1L;
private UmlgSet tag;
private UmlgSet createdOn;
private UmlgSet updatedOn;
private String tmpId; // tmpId is only used the umlg restlet gui. It is never persisted. Its value is generated by the gui.
/**
* constructor for BaseModelUmlg
*
* @param id
*/
public BaseModelUmlg(Object id) {
super(id);
}
/**
* constructor for BaseModelUmlg
*
* @param vertex
*/
public BaseModelUmlg(Vertex vertex) {
super(vertex);
}
/**
* default constructor for BaseModelUmlg
*/
public BaseModelUmlg() {
this(true);
}
/**
* constructor for BaseModelUmlg
*
* @param persistent
*/
public BaseModelUmlg(Boolean persistent) {
super(persistent);
}
public void addToCreatedOn(LocalDateTime createdOn) {
if ( !this.createdOn.isEmpty() ) {
throw new RuntimeException("Property is a one and already has value, first clear it before adding!");
}
if ( createdOn != null ) {
List violations = validateCreatedOn(createdOn);
if ( violations.isEmpty() ) {
this.createdOn.add(createdOn);
} else {
throw new UmlgConstraintViolationException(violations);
}
}
}
public void addToCreatedOnIgnoreInverse(LocalDateTime createdOn) {
if ( !this.createdOn.isEmpty() ) {
throw new RuntimeException("Property is a one and already has value, first clear it before adding!");
}
if ( createdOn != null ) {
List violations = validateCreatedOn(createdOn);
if ( violations.isEmpty() ) {
this.createdOn.add(createdOn);
} else {
throw new UmlgConstraintViolationException(violations);
}
}
}
public void addToTag(Tag tag) {
if ( tag != null ) {
this.tag.add(tag);
}
}
public void addToTag(UmlgSet tag) {
if ( !tag.isEmpty() ) {
this.tag.addAll(tag);
}
}
public void addToTagIgnoreInverse(Tag tag) {
if ( tag != null ) {
this.tag.addIgnoreInverse(tag);
}
}
public void addToUpdatedOn(LocalDateTime updatedOn) {
if ( !this.updatedOn.isEmpty() ) {
throw new RuntimeException("Property is a one and already has value, first clear it before adding!");
}
if ( updatedOn != null ) {
List violations = validateUpdatedOn(updatedOn);
if ( violations.isEmpty() ) {
this.updatedOn.add(updatedOn);
} else {
throw new UmlgConstraintViolationException(violations);
}
}
}
public void addToUpdatedOnIgnoreInverse(LocalDateTime updatedOn) {
if ( !this.updatedOn.isEmpty() ) {
throw new RuntimeException("Property is a one and already has value, first clear it before adding!");
}
if ( updatedOn != null ) {
List violations = validateUpdatedOn(updatedOn);
if ( violations.isEmpty() ) {
this.updatedOn.add(updatedOn);
} else {
throw new UmlgConstraintViolationException(violations);
}
}
}
static public UmlgSet extends BaseModelUmlg> allInstances(Filter filter) {
UmlgSet result = new UmlgMemorySet();
result.addAll(UMLG.get().allInstances(Angel.class.getName(), filter));
result.addAll(UMLG.get().allInstances(BaseClassUmlg.class.getName(), filter));
result.addAll(UMLG.get().allInstances(Biped.class.getName(), filter));
result.addAll(UMLG.get().allInstances(ClassQuery.class.getName(), filter));
result.addAll(UMLG.get().allInstances(Creature.class.getName(), filter));
result.addAll(UMLG.get().allInstances(Demon.class.getName(), filter));
result.addAll(UMLG.get().allInstances(Devil1.class.getName(), filter));
result.addAll(UMLG.get().allInstances(Devil2.class.getName(), filter));
result.addAll(UMLG.get().allInstances(Devil3.class.getName(), filter));
result.addAll(UMLG.get().allInstances(Dream.class.getName(), filter));
result.addAll(UMLG.get().allInstances(FakeRootFolder.class.getName(), filter));
result.addAll(UMLG.get().allInstances(Fantasy.class.getName(), filter));
result.addAll(UMLG.get().allInstances(Finger.class.getName(), filter));
result.addAll(UMLG.get().allInstances(Folder.class.getName(), filter));
result.addAll(UMLG.get().allInstances(Foot.class.getName(), filter));
result.addAll(UMLG.get().allInstances(God.class.getName(), filter));
result.addAll(UMLG.get().allInstances(Hand.class.getName(), filter));
result.addAll(UMLG.get().allInstances(Level1.class.getName(), filter));
result.addAll(UMLG.get().allInstances(Level2.class.getName(), filter));
result.addAll(UMLG.get().allInstances(Level3.class.getName(), filter));
result.addAll(UMLG.get().allInstances(Mamal.class.getName(), filter));
result.addAll(UMLG.get().allInstances(ManyA.class.getName(), filter));
result.addAll(UMLG.get().allInstances(ManyB.class.getName(), filter));
result.addAll(UMLG.get().allInstances(Nature.class.getName(), filter));
result.addAll(UMLG.get().allInstances(Nevil1.class.getName(), filter));
result.addAll(UMLG.get().allInstances(Nevil2.class.getName(), filter));
result.addAll(UMLG.get().allInstances(Nevil3.class.getName(), filter));
result.addAll(UMLG.get().allInstances(Nightmare.class.getName(), filter));
result.addAll(UMLG.get().allInstances(NonNavigableMany.class.getName(), filter));
result.addAll(UMLG.get().allInstances(NonNavigableOne.class.getName(), filter));
result.addAll(UMLG.get().allInstances(OneOne.class.getName(), filter));
result.addAll(UMLG.get().allInstances(OneTwo.class.getName(), filter));
result.addAll(UMLG.get().allInstances(Phantom.class.getName(), filter));
result.addAll(UMLG.get().allInstances(Quadped.class.getName(), filter));
result.addAll(UMLG.get().allInstances(RealRootFolder.class.getName(), filter));
result.addAll(UMLG.get().allInstances(RootQuery.class.getName(), filter));
result.addAll(UMLG.get().allInstances(Space.class.getName(), filter));
result.addAll(UMLG.get().allInstances(SpaceTime.class.getName(), filter));
result.addAll(UMLG.get().allInstances(SpecialCreature.class.getName(), filter));
result.addAll(UMLG.get().allInstances(Spook.class.getName(), filter));
result.addAll(UMLG.get().allInstances(Time.class.getName(), filter));
result.addAll(UMLG.get().allInstances(Universe.class.getName(), filter));
result.addAll(UMLG.get().allInstances(ValidationTest.class.getName(), filter));
result.addAll(UMLG.get().allInstances(World.class.getName(), filter));
return result;
}
static public UmlgSet extends BaseModelUmlg> allInstances() {
UmlgSet result = new UmlgMemorySet();
result.addAll(UMLG.get().allInstances(Angel.class.getName()));
result.addAll(UMLG.get().allInstances(BaseClassUmlg.class.getName()));
result.addAll(UMLG.get().allInstances(Biped.class.getName()));
result.addAll(UMLG.get().allInstances(ClassQuery.class.getName()));
result.addAll(UMLG.get().allInstances(Creature.class.getName()));
result.addAll(UMLG.get().allInstances(Demon.class.getName()));
result.addAll(UMLG.get().allInstances(Devil1.class.getName()));
result.addAll(UMLG.get().allInstances(Devil2.class.getName()));
result.addAll(UMLG.get().allInstances(Devil3.class.getName()));
result.addAll(UMLG.get().allInstances(Dream.class.getName()));
result.addAll(UMLG.get().allInstances(FakeRootFolder.class.getName()));
result.addAll(UMLG.get().allInstances(Fantasy.class.getName()));
result.addAll(UMLG.get().allInstances(Finger.class.getName()));
result.addAll(UMLG.get().allInstances(Folder.class.getName()));
result.addAll(UMLG.get().allInstances(Foot.class.getName()));
result.addAll(UMLG.get().allInstances(God.class.getName()));
result.addAll(UMLG.get().allInstances(Hand.class.getName()));
result.addAll(UMLG.get().allInstances(Level1.class.getName()));
result.addAll(UMLG.get().allInstances(Level2.class.getName()));
result.addAll(UMLG.get().allInstances(Level3.class.getName()));
result.addAll(UMLG.get().allInstances(Mamal.class.getName()));
result.addAll(UMLG.get().allInstances(ManyA.class.getName()));
result.addAll(UMLG.get().allInstances(ManyB.class.getName()));
result.addAll(UMLG.get().allInstances(Nature.class.getName()));
result.addAll(UMLG.get().allInstances(Nevil1.class.getName()));
result.addAll(UMLG.get().allInstances(Nevil2.class.getName()));
result.addAll(UMLG.get().allInstances(Nevil3.class.getName()));
result.addAll(UMLG.get().allInstances(Nightmare.class.getName()));
result.addAll(UMLG.get().allInstances(NonNavigableMany.class.getName()));
result.addAll(UMLG.get().allInstances(NonNavigableOne.class.getName()));
result.addAll(UMLG.get().allInstances(OneOne.class.getName()));
result.addAll(UMLG.get().allInstances(OneTwo.class.getName()));
result.addAll(UMLG.get().allInstances(Phantom.class.getName()));
result.addAll(UMLG.get().allInstances(Quadped.class.getName()));
result.addAll(UMLG.get().allInstances(RealRootFolder.class.getName()));
result.addAll(UMLG.get().allInstances(RootQuery.class.getName()));
result.addAll(UMLG.get().allInstances(Space.class.getName()));
result.addAll(UMLG.get().allInstances(SpaceTime.class.getName()));
result.addAll(UMLG.get().allInstances(SpecialCreature.class.getName()));
result.addAll(UMLG.get().allInstances(Spook.class.getName()));
result.addAll(UMLG.get().allInstances(Time.class.getName()));
result.addAll(UMLG.get().allInstances(Universe.class.getName()));
result.addAll(UMLG.get().allInstances(ValidationTest.class.getName()));
result.addAll(UMLG.get().allInstances(World.class.getName()));
return result;
}
@Override
public List checkClassConstraints() {
List result = new ArrayList();
return result;
}
public void clearCreatedOn() {
this.createdOn.clear();
}
public void clearTag() {
this.tag.clear();
}
public void clearUpdatedOn() {
this.updatedOn.clear();
}
@Override
public void delete() {
this.updatedOn.clear();
this.tag.clear();
this.createdOn.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("updatedOn") ) {
if ( propertyMap.get("updatedOn") != null ) {
LocalDateTime updatedOn = UmlgFormatter.parseDateTime((String)propertyMap.get("updatedOn"));
setUpdatedOn(updatedOn);
} else {
setUpdatedOn(null);
}
}
if ( propertyMap.containsKey("createdOn") ) {
if ( propertyMap.get("createdOn") != null ) {
LocalDateTime createdOn = UmlgFormatter.parseDateTime((String)propertyMap.get("createdOn"));
setCreatedOn(createdOn);
} else {
setCreatedOn(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 LocalDateTime getCreatedOn() {
UmlgSet tmp = this.createdOn;
if ( !tmp.isEmpty() ) {
return tmp.iterator().next();
} else {
return null;
}
}
@Override
public String getMetaDataAsJson() {
return BaseModelUmlg.BaseModelUmlgRuntimePropertyEnum.asJson();
}
@Override
public UmlgNode getOwningObject() {
return null;
}
@Override
public String getQualifiedName() {
return "umlglib::org::umlg::BaseModelUmlg";
}
/**
* 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();
BaseModelUmlgRuntimePropertyEnum runtimeProperty;
if ( !inverse ) {
runtimeProperty = BaseModelUmlgRuntimePropertyEnum.fromQualifiedName(tumlRuntimeProperty.getQualifiedName());
} else {
runtimeProperty = BaseModelUmlgRuntimePropertyEnum.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;
BaseModelUmlgRuntimePropertyEnum runtimeProperty;
if ( !inverse ) {
runtimeProperty = BaseModelUmlgRuntimePropertyEnum.fromQualifiedName(tumlRuntimeProperty.getQualifiedName());
} else {
runtimeProperty = BaseModelUmlgRuntimePropertyEnum.fromQualifiedName(tumlRuntimeProperty.getInverseQualifiedName());
}
if ( runtimeProperty != null && result == 0 ) {
switch ( runtimeProperty ) {
case updatedOn:
result = updatedOn.size();
break;
case tag:
result = tag.size();
break;
case createdOn:
result = createdOn.size();
break;
default:
result = 0;
}
}
return result;
}
public UmlgSet getTag() {
return this.tag;
}
@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;
}
public LocalDateTime getUpdatedOn() {
UmlgSet tmp = this.updatedOn;
if ( !tmp.isEmpty() ) {
return tmp.iterator().next();
} else {
return null;
}
}
@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.updatedOn = new UmlgSetImpl(this, PropertyTree.from(BaseModelUmlgRuntimePropertyEnum.updatedOn), loaded);
this.tag = new UmlgSetImpl(this, PropertyTree.from(BaseModelUmlgRuntimePropertyEnum.tag), loaded);
this.createdOn = new UmlgSetImpl(this, PropertyTree.from(BaseModelUmlgRuntimePropertyEnum.createdOn), loaded);
}
@Override
public void initialiseProperty(UmlgRuntimeProperty tumlRuntimeProperty, boolean inverse, boolean loaded) {
BaseModelUmlgRuntimePropertyEnum runtimeProperty;
if ( !inverse ) {
runtimeProperty = (BaseModelUmlgRuntimePropertyEnum.fromQualifiedName(tumlRuntimeProperty.getQualifiedName()));
} else {
runtimeProperty = (BaseModelUmlgRuntimePropertyEnum.fromQualifiedName(tumlRuntimeProperty.getInverseQualifiedName()));
}
if ( runtimeProperty != null ) {
switch ( runtimeProperty ) {
case updatedOn:
this.updatedOn = new UmlgSetImpl(this, PropertyTree.from(BaseModelUmlgRuntimePropertyEnum.updatedOn), loaded);
break;
case tag:
this.tag = new UmlgSetImpl(this, PropertyTree.from(BaseModelUmlgRuntimePropertyEnum.tag), loaded);
break;
case createdOn:
this.createdOn = new UmlgSetImpl(this, PropertyTree.from(BaseModelUmlgRuntimePropertyEnum.createdOn), loaded);
break;
}
}
}
@Override
public UmlgRuntimeProperty inverseAdder(UmlgRuntimeProperty tumlRuntimeProperty, boolean inverse, UmlgNode umlgNode) {
BaseModelUmlgRuntimePropertyEnum runtimeProperty;
if ( !inverse ) {
runtimeProperty = (BaseModelUmlgRuntimePropertyEnum.fromQualifiedName(tumlRuntimeProperty.getQualifiedName()));
} else {
runtimeProperty = (BaseModelUmlgRuntimePropertyEnum.fromQualifiedName(tumlRuntimeProperty.getInverseQualifiedName()));
}
if ( runtimeProperty != null ) {
switch ( runtimeProperty ) {
case tag:
this.tag.inverseAdder((Tag)umlgNode);
break;
}
return runtimeProperty;
} else {
return null;
}
}
@Override
public boolean isTinkerRoot() {
return true;
}
public UmlgSet lookupFor_baseUmlg_tag() {
UmlgSet result = new UmlgMemorySet();
Filter filter = new Filter() {
@Override
public boolean filter(Tag entity){
return !entity.getBaseUmlg().contains(BaseModelUmlg.this);
}
};
result.addAll(org.umlg.tag.Tag.allInstances(filter));
return result;
}
public void removeFromCreatedOn(LocalDateTime createdOn) {
if ( createdOn != null ) {
this.createdOn.remove(createdOn);
}
}
public void removeFromCreatedOn(UmlgSet createdOn) {
if ( !createdOn.isEmpty() ) {
this.createdOn.removeAll(createdOn);
}
}
public void removeFromTag(Tag tag) {
if ( tag != null ) {
this.tag.remove(tag);
}
}
public void removeFromTag(UmlgSet tag) {
if ( !tag.isEmpty() ) {
this.tag.removeAll(tag);
}
}
public void removeFromUpdatedOn(LocalDateTime updatedOn) {
if ( updatedOn != null ) {
this.updatedOn.remove(updatedOn);
}
}
public void removeFromUpdatedOn(UmlgSet updatedOn) {
if ( !updatedOn.isEmpty() ) {
this.updatedOn.removeAll(updatedOn);
}
}
public void setCreatedOn(LocalDateTime createdOn) {
if ( createdOn == null ) {
clearCreatedOn();
} else {
z_internalClearCreatedOn();
}
addToCreatedOn(createdOn);
}
public void setTag(UmlgSet tag) {
clearTag();
if ( tag != null ) {
addToTag(tag);
}
}
public void setUpdatedOn(LocalDateTime updatedOn) {
if ( updatedOn == null ) {
clearUpdatedOn();
} else {
z_internalClearUpdatedOn();
}
addToUpdatedOn(updatedOn);
}
/**
* 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("\"updatedOn\": " + (getUpdatedOn() != null ? "\"" + UmlgFormatter.format(getUpdatedOn()) + "\"" : null ));
sb.append(", ");
sb.append("\"createdOn\": " + (getCreatedOn() != null ? "\"" + UmlgFormatter.format(getCreatedOn()) + "\"" : 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("\"updatedOn\": " + (getUpdatedOn() != null ? "\"" + UmlgFormatter.format(getUpdatedOn()) + "\"" : null ));
sb.append(", ");
sb.append("\"createdOn\": " + (getCreatedOn() != null ? "\"" + UmlgFormatter.format(getCreatedOn()) + "\"" : 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);
}
public List validateCreatedOn(LocalDateTime createdOn) {
List result = new ArrayList();
return result;
}
@Override
public List validateMultiplicities() {
List result = new ArrayList();
if ( getUpdatedOn() == null ) {
result.add(new UmlgConstraintViolation("multiplicity", "umlglib::org::umlg::BaseModelUmlg::updatedOn", "lower multiplicity is 1"));
}
if ( getCreatedOn() == null ) {
result.add(new UmlgConstraintViolation("multiplicity", "umlglib::org::umlg::BaseModelUmlg::createdOn", "lower multiplicity is 1"));
}
return result;
}
public List validateUpdatedOn(LocalDateTime updatedOn) {
List result = new ArrayList();
return result;
}
@Override
public void z_internalAddPersistentValueToCollection(UmlgRuntimeProperty umlgRuntimeProperty, Object umlgNode) {
BaseModelUmlgRuntimePropertyEnum runtimeProperty;
runtimeProperty = (BaseModelUmlgRuntimePropertyEnum.fromQualifiedName(umlgRuntimeProperty.getQualifiedName()));
if ( runtimeProperty != null ) {
switch ( runtimeProperty ) {
case updatedOn:
this.updatedOn.z_internalAdder(UmlgFormatter.parse(BaseModelUmlgRuntimePropertyEnum.updatedOn.getDataTypeEnum(), umlgNode));
break;
case tag:
this.tag.z_internalAdder((Tag)umlgNode);
break;
case createdOn:
this.createdOn.z_internalAdder(UmlgFormatter.parse(BaseModelUmlgRuntimePropertyEnum.createdOn.getDataTypeEnum(), umlgNode));
break;
}
}
}
@Override
public void z_internalAddToCollection(UmlgRuntimeProperty umlgRuntimeProperty, Object umlgNode) {
BaseModelUmlgRuntimePropertyEnum runtimeProperty;
runtimeProperty = (BaseModelUmlgRuntimePropertyEnum.fromQualifiedName(umlgRuntimeProperty.getQualifiedName()));
if ( runtimeProperty != null ) {
switch ( runtimeProperty ) {
case updatedOn:
this.updatedOn.z_internalAdder((LocalDateTime)umlgNode);
break;
case tag:
this.tag.z_internalAdder((Tag)umlgNode);
break;
case createdOn:
this.createdOn.z_internalAdder((LocalDateTime)umlgNode);
break;
}
}
}
@Override
public Set z_internalBooleanProperties() {
Set result = new HashSet();
return result;
}
public void z_internalClearCreatedOn() {
this.createdOn.z_internalClear();
}
public void z_internalClearTag() {
this.tag.z_internalClear();
}
public void z_internalClearUpdatedOn() {
this.updatedOn.z_internalClear();
}
@Override
public Set z_internalDataTypeProperties() {
Set result = new HashSet();
result.add(BaseModelUmlgRuntimePropertyEnum.updatedOn);
result.add(BaseModelUmlgRuntimePropertyEnum.createdOn);
return result;
}
@Override
public Map z_internalDataTypePropertiesWithDefaultValues() {
Map result = new HashMap();
result.put(BaseModelUmlgRuntimePropertyEnum.updatedOn, LocalDateTime.now());
result.put(BaseModelUmlgRuntimePropertyEnum.createdOn, LocalDateTime.now());
return result;
}
@Override
public UmlgCollection extends Object> z_internalGetCollectionFor(UmlgRuntimeProperty tumlRuntimeProperty, boolean inverse) {
UmlgCollection extends Object> result = null;
if ( result == null ) {
BaseModelUmlgRuntimePropertyEnum runtimeProperty;
if ( !inverse ) {
runtimeProperty = (BaseModelUmlgRuntimePropertyEnum.fromQualifiedName(tumlRuntimeProperty.getQualifiedName()));
} else {
runtimeProperty = (BaseModelUmlgRuntimePropertyEnum.fromQualifiedName(tumlRuntimeProperty.getInverseQualifiedName()));
}
if ( runtimeProperty != null ) {
switch ( runtimeProperty ) {
case updatedOn:
result = this.updatedOn;
break;
case tag:
result = this.tag;
break;
case createdOn:
result = this.createdOn;
break;
}
}
}
return result;
}
@Override
public UmlgRuntimeProperty z_internalInverseAdder(UmlgRuntimeProperty tumlRuntimeProperty, boolean inverse, UmlgNode umlgNode) {
BaseModelUmlgRuntimePropertyEnum runtimeProperty;
if ( !inverse ) {
runtimeProperty = (BaseModelUmlgRuntimePropertyEnum.fromQualifiedName(tumlRuntimeProperty.getQualifiedName()));
} else {
runtimeProperty = (BaseModelUmlgRuntimePropertyEnum.fromQualifiedName(tumlRuntimeProperty.getInverseQualifiedName()));
}
if ( runtimeProperty != null ) {
switch ( runtimeProperty ) {
case tag:
this.tag.z_internalAdder((Tag)umlgNode);
break;
}
return runtimeProperty;
} else {
return null;
}
}
@Override
public void z_internalMarkCollectionLoaded(UmlgRuntimeProperty umlgRuntimeProperty, boolean loaded) {
BaseModelUmlgRuntimePropertyEnum runtimeProperty;
runtimeProperty = (BaseModelUmlgRuntimePropertyEnum.fromQualifiedName(umlgRuntimeProperty.getQualifiedName()));
if ( runtimeProperty != null ) {
switch ( runtimeProperty ) {
case updatedOn:
this.updatedOn.setLoaded(loaded);
break;
case tag:
this.tag.setLoaded(loaded);
break;
case createdOn:
this.createdOn.setLoaded(loaded);
break;
}
}
}
static public enum BaseModelUmlgRuntimePropertyEnum implements UmlgRuntimeProperty {
updatedOn(/* qualifiedName */ "umlglib::org::umlg::BaseModelUmlg::updatedOn",/* persistentName */ "updatedOn",/* inverseName */ "inverseOf::updatedOn",/* inverseQualifiedName */ "inverseOf::umlglib::org::umlg::BaseModelUmlg::updatedOn",/* isAssociationClassOne */ false,/* isMemberEndOfAssociationClass */ false,/* associationClassPropertyNameField */ "null",/* inverseAssociationClassPropertyNameField */ "null",/* isAssociationClassProperty */ false,/* isOnePrimitivePropertyOfAssociationClass */ false,/* isOnePrimitive */ false,/* isReadOnly */ false,/* dataTypeEnum */ DataTypeEnum.DateTime,/* validations */ Arrays.asList(new DateTimeValidation()),/* isManyPrimitive */ false,/* oneEnumeration */ false,/* manyEnumeration */ false,/* isControllingSide */ true,/* isComposite */ false,/* isInverseComposite */ false,/* label */ UmlgLabelConverterFactory.getUmlgLabelConverter().convert("updatedOn"),/* 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 */ LocalDateTime.class,/* json */ "{\"name\": \"updatedOn\", \"associationClassOne\": false, \"memberEndOfAssociationClass\": false, \"associationClassPropertyName\": null, \"inverseAssociationClassPropertyName\": null, \"associationClassProperty\": false, \"onePrimitivePropertyOfAssociationClass\": false, \"onePrimitive\": false, \"readOnly\": false, \"dataTypeEnum\": \"" + DataTypeEnum.DateTime.toString() + "\", \"validations\": {\"dateTime\": {}}, \"qualifiedName\": \"umlglib::org::umlg::BaseModelUmlg::updatedOn\", \"persistentName\": \"updatedOn\", \"inverseName\": \"inverseOf::updatedOn\", \"inverseQualifiedName\": \"inverseOf::umlglib::org::umlg::BaseModelUmlg::updatedOn\", \"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\": \"updatedOn\", \"qualified\": false, \"inverseQualified\": false, \"ordered\": false, \"inverseOrdered\": false, \"unique\": true, \"inverseUnique\": false, \"derived\": false, \"navigable\": true}",/* isChangeListenerAttribute */ false),
tag(/* qualifiedName */ "umlglib::org::umlg::tag::tag_baseUmlg_1::tag",/* persistentName */ "tag",/* inverseName */ "baseUmlg",/* inverseQualifiedName */ "umlglib::org::umlg::tag::Tag::baseUmlg",/* 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 */ false,/* label */ UmlgLabelConverterFactory.getUmlgLabelConverter().convert("tag_baseUmlg_1"),/* isOneToOne */ false,/* isOneToMany */ false,/* isManyToOne */ false,/* isManyToMany */ true,/* upper */ -1,/* lower */ 0,/* inverseUpper */ -1,/* isQualified */ false,/* isInverseQualified */ false,/* isOrdered */ false,/* isInverseOrdered */ false,/* isUnique */ true,/* isInverseUnique */ true,/* isDerived */ false,/* isNavigable */ true,/* propertyType */ Tag.class,/* json */ "{\"name\": \"tag\", \"associationClassOne\": false, \"memberEndOfAssociationClass\": false, \"associationClassPropertyName\": null, \"inverseAssociationClassPropertyName\": null, \"associationClassProperty\": false, \"onePrimitivePropertyOfAssociationClass\": false, \"onePrimitive\": false, \"readOnly\": false, \"dataTypeEnum\": null, \"validations\": null, \"qualifiedName\": \"umlglib::org::umlg::tag::tag_baseUmlg_1::tag\", \"persistentName\": \"tag\", \"inverseName\": \"baseUmlg\", \"inverseQualifiedName\": \"umlglib::org::umlg::tag::Tag::baseUmlg\", \"manyPrimitive\": false, \"oneEnumeration\": false, \"manyEnumeration\": false, \"controllingSide\": false, \"composite\": false, \"inverseComposite\": false, \"oneToOne\": false, \"oneToMany\": false, \"manyToOne\": false, \"manyToMany\": true, \"upper\": -1, \"lower\": 0, \"inverseUpper\": -1, \"label\": \"tag_baseUmlg_1\", \"qualified\": false, \"inverseQualified\": false, \"ordered\": false, \"inverseOrdered\": false, \"unique\": true, \"inverseUnique\": true, \"derived\": false, \"navigable\": true}",/* isChangeListenerAttribute */ false),
createdOn(/* qualifiedName */ "umlglib::org::umlg::BaseModelUmlg::createdOn",/* persistentName */ "createdOn",/* inverseName */ "inverseOf::createdOn",/* inverseQualifiedName */ "inverseOf::umlglib::org::umlg::BaseModelUmlg::createdOn",/* isAssociationClassOne */ false,/* isMemberEndOfAssociationClass */ false,/* associationClassPropertyNameField */ "null",/* inverseAssociationClassPropertyNameField */ "null",/* isAssociationClassProperty */ false,/* isOnePrimitivePropertyOfAssociationClass */ false,/* isOnePrimitive */ false,/* isReadOnly */ false,/* dataTypeEnum */ DataTypeEnum.DateTime,/* validations */ Arrays.asList(new DateTimeValidation()),/* isManyPrimitive */ false,/* oneEnumeration */ false,/* manyEnumeration */ false,/* isControllingSide */ true,/* isComposite */ false,/* isInverseComposite */ false,/* label */ UmlgLabelConverterFactory.getUmlgLabelConverter().convert("createdOn"),/* 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 */ LocalDateTime.class,/* json */ "{\"name\": \"createdOn\", \"associationClassOne\": false, \"memberEndOfAssociationClass\": false, \"associationClassPropertyName\": null, \"inverseAssociationClassPropertyName\": null, \"associationClassProperty\": false, \"onePrimitivePropertyOfAssociationClass\": false, \"onePrimitive\": false, \"readOnly\": false, \"dataTypeEnum\": \"" + DataTypeEnum.DateTime.toString() + "\", \"validations\": {\"dateTime\": {}}, \"qualifiedName\": \"umlglib::org::umlg::BaseModelUmlg::createdOn\", \"persistentName\": \"createdOn\", \"inverseName\": \"inverseOf::createdOn\", \"inverseQualifiedName\": \"inverseOf::umlglib::org::umlg::BaseModelUmlg::createdOn\", \"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\": \"createdOn\", \"qualified\": false, \"inverseQualified\": false, \"ordered\": false, \"inverseOrdered\": false, \"unique\": true, \"inverseUnique\": false, \"derived\": false, \"navigable\": true}",/* isChangeListenerAttribute */ false),
umlglib(/* qualifiedName */ "umlglib",/* persistentName */ "umlglib",/* inverseName */ "inverseOfumlglib",/* inverseQualifiedName */ "inverseOfumlglib",/* 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("rootBaseModelUmlg"),/* 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\": \"umlglib\", \"associationClassOne\": false, \"memberEndOfAssociationClass\": false, \"associationClassPropertyName\": null, \"inverseAssociationClassPropertyName\": null, \"associationClassProperty\": false, \"onePrimitivePropertyOfAssociationClass\": false, \"onePrimitive\": false, \"readOnly\": false, \"dataTypeEnum\": null, \"validations\": null, \"qualifiedName\": \"umlglib\", \"persistentName\": \"umlglib\", \"inverseName\": \"inverseOfumlglib\", \"inverseQualifiedName\": \"inverseOfumlglib\", \"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\": \"rootBaseModelUmlg\", \"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 BaseModelUmlgRuntimePropertyEnum
*
* @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 BaseModelUmlgRuntimePropertyEnum(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\": \"BaseModelUmlg\", ");
sb.append("\"qualifiedName\": \"umlglib::org::umlg::BaseModelUmlg\", ");
sb.append("\"uri\": \"TODO\", ");
sb.append("\"properties\": [");
for ( BaseModelUmlgRuntimePropertyEnum l : BaseModelUmlgRuntimePropertyEnum.values() ) {
sb.append(l.toJson());
if ( count < BaseModelUmlgRuntimePropertyEnum.values().length ) {
count++;
sb.append(",");
}
}
sb.append("]}");
return sb.toString();
}
static public BaseModelUmlgRuntimePropertyEnum fromInverseQualifiedName(String inverseQualifiedName) {
if ( umlglib.getInverseQualifiedName().equals(inverseQualifiedName) ) {
return umlglib;
}
if ( createdOn.getInverseQualifiedName().equals(inverseQualifiedName) ) {
return createdOn;
}
if ( tag.getInverseQualifiedName().equals(inverseQualifiedName) ) {
return tag;
}
if ( updatedOn.getInverseQualifiedName().equals(inverseQualifiedName) ) {
return updatedOn;
}
return null;
}
static public BaseModelUmlgRuntimePropertyEnum fromLabel(String _label) {
if ( umlglib.getLabel().equals(_label) ) {
return umlglib;
}
if ( createdOn.getLabel().equals(_label) ) {
return createdOn;
}
if ( tag.getLabel().equals(_label) ) {
return tag;
}
if ( updatedOn.getLabel().equals(_label) ) {
return updatedOn;
}
return null;
}
static public BaseModelUmlgRuntimePropertyEnum fromQualifiedName(String qualifiedName) {
if ( umlglib.getQualifiedName().equals(qualifiedName) ) {
return umlglib;
}
if ( createdOn.getQualifiedName().equals(qualifiedName) ) {
return createdOn;
}
if ( tag.getQualifiedName().equals(qualifiedName) ) {
return tag;
}
if ( updatedOn.getQualifiedName().equals(qualifiedName) ) {
return updatedOn;
}
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