UserConcept class

Inheritance

Constructors

UserConcept(Model model, String conceptCode)

Properties

abstract bool
getter/setter pairinherited
attributes Attributes
getter/setter pairinherited
canAdd bool
getter/setter pairinherited
childCodeInternalPaths List<String>
no setterinherited
children Children
getter/setter pairinherited
code String
An optional human-readable string code identifying the entity. If null, defaults to 'code'. If concept says updateCode is false, cannot update.
getter/setter pairinherited
codeFirstLetterLower String
Utility property returning the code's first letter in lowercase.
no setterinherited
codeFirstLetterUpper String
Utility property returning the code's first letter in uppercase.
no setterinherited
codeLowerSpace String
Utility property returning the code in lower space-separated form.
no setterinherited
codeLowerUnderscore String
Utility property returning the code in lower_snake_case form.
no setterinherited
codePlural String
Utility property returning the code in plural form.
no setterinherited
codePluralFirstLetterLower String
Utility property returning the plural code, first letter lowercased.
no setterinherited
codePluralFirstLetterUpper String
Utility property returning the plural code, first letter uppercased.
no setterinherited
codePluralFirstLetterUpperSpace String
Utility property returning the plural code in a spaced form with uppercase first letter.
no setterinherited
codePluralLowerUnderscore String
Utility property returning the plural code in lower_snake_case.
no setterinherited
codes String
getter/setter pairinherited
codesFirstLetterLower String
getter/setter pairinherited
codesLowerUnderscore String
getter/setter pairinherited
concept Concept
The Concept describing the domain structure for this entity. If _concept is null, throws EDNetException.
getter/setter pairinherited
description String
getter/setter pairinherited
entry bool
getter/setter pairinherited
entryConcept Concept
no setterinherited
entryConceptThisConceptInternalPath String?
no setterinherited
essentialAttributes List<Attribute>
no setterinherited
exceptions IValidationExceptions
Accumulates validation or policy violation exceptions. Each time entity updates happen, exceptions may record domain errors.
getter/setter pairinherited
externalParents List<Parent>
no setterinherited
externalRequiredParents List<Parent>
no setterinherited
hasAttributeId bool
no setterinherited
hashCode int
Hashes the entity by its oid.
no setterinherited
hasId bool
no setterinherited
hasParentId bool
no setterinherited
hasReflexiveChild bool
no setterinherited
hasReflexiveParent bool
no setterinherited
hasTwinChild bool
no setterinherited
hasTwinParent bool
no setterinherited
id Id
The Id aggregates all identifier attributes or parent references. If the concept has none, returns null.
no setterinherited
identifierAttributes List<Attribute>
no setterinherited
incrementAttributes List<Attribute>
no setterinherited
internalChildren List<Child>
no setterinherited
label String?
getter/setter pairinherited
labels String?
getter/setter pairinherited
max String
getter/setter pairinherited
min String
getter/setter pairinherited
model Model
getter/setter pairinherited
nonIdentifierAttributes List<Attribute>
no setterinherited
nonIncrementAttributes List<Attribute>
no setterinherited
oid Oid
Unique object identifier (OID) for the entity. By default, this is assigned on creation, but can be changed if concept.updateOid is true.
getter/setter pairinherited
parents Parents
getter/setter pairinherited
policyEvaluator PolicyEvaluator
Allows external configuration of the PolicyEvaluator.
no getterinherited
post bool
getter/setter pairinherited
pre bool
Hooks to control pre/post conditions on attribute/relationship changes. pre indicates if we do pre-validation logic, post for post-validation.
getter/setter pairinherited
remove bool
getter/setter pairinherited
requiredAttributes List<Attribute>
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
singleValueProperties List<Property>
no setterinherited
sourceChildren Children
getter/setter pairinherited
sourceParents Parents
getter/setter pairinherited
updateCode bool
getter/setter pairinherited
updateOid bool
getter/setter pairinherited
updateWhen bool
getter/setter pairinherited
whenAdded DateTime?
Timestamp of when the entity was first created or added. Only updatable if concept.updateWhen is true.
getter/setter pairinherited
whenRemoved DateTime?
Timestamp of when the entity was logically removed. Only updatable if concept.updateWhen is true.
getter/setter pairinherited
whenSet DateTime?
Timestamp of the latest attribute or relationship update. Used for partial concurrency or auditing.
getter/setter pairinherited

Methods

compareAttributes(Concept entity) int
Compare attributes one by one until a difference is found. Return negative if this < that; zero if same; positive if this > that.
inherited
compareTo(dynamic entity) int
Compare two entities, primarily using code, otherwise id, otherwise attribute comparisons. If negative, this < that; zero => equal; positive => this > that.
inherited
copy() Concept
Creates a shallow copy of this entity. OID, code, attributes, and references are duplicated. Child/parent references are not deeply cloned but re-linked.
inherited
display({String prefix = '', bool withOid = true, bool withChildren = true, bool withInternalChildren = true}) → void
Displays this entity’s details, including attributes, parents, children.
inherited
displayToString() → void
Prints toString().
inherited
equalContent(Concept entity) bool
Checks if the content (attributes, code, parents, children) matches another entity. Ignores oid, whenAdded, whenSet, whenRemoved.
inherited
equals(Concept concept) bool
Two concepts are equal if their oids are equal.
inherited
evaluatePolicies({String? policyKey}) PolicyEvaluationResult
Evaluates entity-level and model-level policies for this entity. If a policyKey is provided, only that specific policy is evaluated.
inherited
fromJson<K extends Entity<K>>(String entityJson) → void
Populates this entity's data from a JSON string. Deserializes via fromJsonMap.
inherited
fromJsonMap(dynamic entityMap, [Entity<Entity>? internalParent]) → void
Internal: loads entity data from a map entityMap, optionally linking to an internalParent.
inherited
getAttribute<Attribute>(String attributeCode) → Attribute?
Retrieves the attribute value for attributeCode as type K. Returns null if not set.
inherited
getChild(String? name) Object?
Retrieves the child collection matching name. Or null if no such child is defined.
inherited
getDestinationChild(String childCode) Child?
inherited
getDestinationParent(String parentCode) Parent?
inherited
getInternalChild(String name) Object?
Gets the internal child collection reference by name.
inherited
getParent(String name) Object?
Gets the parent entity by name, or null if none.
inherited
getReference(String name) Reference?
Returns the Reference to a parent by name, if any.
inherited
getRelationship(String relationshipName) → dynamic
Retrieves either a parent or child relationship by name. Returns null if neither is found.
inherited
getSourceChild(String childCode) Child?
inherited
getSourceParent(String parentCode) Parent?
inherited
getStringFromAttribute(String name) String?
Returns the attribute value as a string. If the value is null, returns 'null'.
inherited
getStringOrNullFromAttribute(String name) String?
Returns the attribute value as a nullable string, or null if no value.
inherited
isAttributeSensitive(String attributeCode) bool
inherited
isChild(String relationshipName) → dynamic
inherited
isChildSensitive(String childCode) bool
inherited
isParent(String relationshipName) → dynamic
inherited
isParentSensitive(String parentCode) bool
inherited
isPropertySensitive(String propertyCode) bool
inherited
newEntities() Entities<Concept>
Creates a new Entities<E> collection that can hold instances of this entity. The new collection references the same Concept.
inherited
newEntity() Entity<Concept>
Creates a new empty instance of this entity type. The returned entity has the same Concept as the original.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
postSetAttribute(String name, Object? value) bool
Called after setting an attribute. If post is true, can run additional checks. Return false if you want to revert the update.
inherited
preSetAttribute(String name, Object? value) bool
Called before setting an attribute. If pre is true, can run additional checks. If returns false, attribute set operation is not performed.
inherited
removeParent(String name) → dynamic
Removes a parent reference by name, if parent.update is true. Reverts if policies are violated.
inherited
setAttribute(String name, Object? value) bool
Sets an attribute by name to value, respecting update rules and calling policy checks. Returns true if the attribute was successfully updated. Throws UpdateException if the attribute is not updatable or absent. Also handles policy checks, reverting changes if policies fail.
inherited
setAttributesFrom(Entity<Entity> entity) bool
Bulk-updates this entity’s attributes from another entity if whenSet is older. Only non-identifier attributes are considered. Returns true if all updated.
inherited
setChild(String name, Object entities) bool
Updates a child relationship name with entities. If child.update is false, we throw an UpdateException. If policies fail, we revert.
inherited
setParent(String name, dynamic entity) bool
Sets or updates a parent relationship named name with the given entity. If parent is uninitialized or updatable, we store a reference. If policies fail, we revert.
inherited
setReference(String name, Reference reference) → void
Sets a Reference for a parent name, but only if that parent slot is empty.
inherited
setStringToAttribute(String name, String string) bool
Helper to parse a string and update the attribute name accordingly. If the attribute type is recognized (e.g., int, bool), we parse the string. Otherwise, store the string as-is.
inherited
toGraph() Map<String, dynamic>
Converts this entity to a graph-like structure, including references to parents.
inherited
toJson() String
Serializes this entity to JSON using toJsonMap.
inherited
toJsonMap() Map<String, Object>
Builds a JSON-like Map of this entity's data, including parent references.
inherited
toString() String
Returns a concise string representation using the entity's oid and code.
inherited