Interface IMendixObject
-
public interface IMendixObject
Represents an entity (IMetaObject) instance.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
IMendixObject.ObjectState
Defines the possible object states.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description IMendixObject
clone()
Deprecated.since 9.24.IMendixObject
createClone()
Returns a deep copy of this object.boolean
equals(java.lang.Object obj)
IMendixIdentifier
getChangedBy(IContext context)
Returns the Mendix identifier of the last user that changed this object.java.util.Date
getChangedDate(IContext context)
Returns the last Date that changed in this object.java.util.List<? extends IMendixObjectMember<?>>
getChangedMembers(IContext context)
Returns a list with all members of this object that changed since creation, retrieval or commit.java.util.Date
getCreatedDate(IContext context)
Returns the date/time at which this object was created.IMendixIdentifier
getId()
Returns the identifier of this object.IMendixObjectMember<?>
getMember(IContext context, java.lang.String memberName)
Returns the member object with memberName.java.util.Map<java.lang.String,? extends IMendixObjectMember<?>>
getMembers(IContext context)
Returns a HashMap with all members of this object.IMetaObject
getMetaObject()
Returns the meta object for this object.IMendixIdentifier
getOwner(IContext context)
Returns the IMendixIdentifier of the user that owns this object.java.util.List<? extends IMendixObjectMember<?>>
getPrimitives(IContext context)
Returns a list with all primitive (non-association) members of this object.java.util.List<? extends MendixObjectReference>
getReferences(IContext context)
Returns a list with all 'to-one' association members of this object.java.util.List<? extends MendixObjectReferenceSet>
getReferenceSets(IContext context)
Returns a list with all 'to-many' association members of this object.IMendixObject.ObjectState
getState()
Returns the object state of this object.java.lang.String
getType()
Returns the type of this object as a string.<T> T
getValue(IContext context, java.lang.String memberName)
Returns the value of the member with memberName.java.util.Map<java.lang.String,? extends IMendixObjectMember<?>>
getVirtualMembers(IContext context)
Returns a HashMap with all virtual members of this object.boolean
hasChangedByAttribute()
Returns whether at least one attribute of this object has changed since creation, retrieval or commit.boolean
hasChangedDateAttribute()
Returns whether at least one date attribute of this object has changed since creation, retrieval or commit.boolean
hasCreatedDateAttribute()
Returns whether this object has a created data attribute.boolean
hasDeleteRights(IContext context)
Returns whether this object has delete rights.boolean
hasMember(java.lang.String memberName)
Returns whether this object has a member named memberName.boolean
hasNullValues(IContext context)
Returns whether this object contains empty members.boolean
hasOwnerAttribute()
Returns whether at least one owner attribute of this object has changed since creation, retrieval or commit.boolean
isChanged()
Returns whether at least one member of this object has changed since creation, retrieval or commit.default boolean
isInstanceOf(IMetaObject metaObject)
Returns whether this object is an instance of a given IMetaObject.default boolean
isInstanceOf(java.lang.String metaObject)
Returns whether this object is an instance of a given IMetaObject.boolean
isNew()
Returns whether this object has not been committed yet.boolean
isVirtual(IContext context, java.lang.String name)
Returns whether a certain attribute is virtual.void
setValue(IContext context, java.lang.String memberName, java.lang.Object value)
Set the value for the member with name memberName.
-
-
-
Method Detail
-
getMembers
java.util.Map<java.lang.String,? extends IMendixObjectMember<?>> getMembers(IContext context)
Returns a HashMap with all members of this object.- Parameters:
context
- the context for accessing the object- Returns:
- the map with all members
-
getChangedMembers
java.util.List<? extends IMendixObjectMember<?>> getChangedMembers(IContext context)
Returns a list with all members of this object that changed since creation, retrieval or commit.- Parameters:
context
- the context for accessing the object- Returns:
- the list with all changed members
-
getReferences
java.util.List<? extends MendixObjectReference> getReferences(IContext context)
Returns a list with all 'to-one' association members of this object.- Parameters:
context
- the context for accessing the object- Returns:
- the list with all MendixObjectReferences
-
getReferenceSets
java.util.List<? extends MendixObjectReferenceSet> getReferenceSets(IContext context)
Returns a list with all 'to-many' association members of this object.- Parameters:
context
- the context for accessing the object- Returns:
- the list with all MendixObjectReferenceSets
-
getPrimitives
java.util.List<? extends IMendixObjectMember<?>> getPrimitives(IContext context)
Returns a list with all primitive (non-association) members of this object.- Parameters:
context
- the context for accessing the object- Returns:
- the list with all primitive members
-
getVirtualMembers
java.util.Map<java.lang.String,? extends IMendixObjectMember<?>> getVirtualMembers(IContext context)
Returns a HashMap with all virtual members of this object.- Parameters:
context
- the context for accessing the object- Returns:
- the map with all virtual members
-
isVirtual
boolean isVirtual(IContext context, java.lang.String name)
Returns whether a certain attribute is virtual.- Parameters:
context
- the context for accessing the objectname
- the attribute name- Returns:
- true if the attribute is virtual, false otherwise
-
getType
java.lang.String getType()
Returns the type of this object as a string.- Returns:
- the type
-
setValue
void setValue(IContext context, java.lang.String memberName, java.lang.Object value)
Set the value for the member with name memberName.This method does not update changeDate and changedBy system attributes. Use
ICore.change(IContext, IMendixObject, Map)
if needed.- Parameters:
context
- the context for accessing the objectmemberName
- the name of the member to setvalue
- the value to set
-
getValue
<T> T getValue(IContext context, java.lang.String memberName)
Returns the value of the member with memberName.- Type Parameters:
T
- the type of the member value, which should match the attribute type- Parameters:
context
- the context for accessing the objectmemberName
- the name of the member to get- Returns:
- the value of the member
-
hasMember
boolean hasMember(java.lang.String memberName)
Returns whether this object has a member named memberName.- Parameters:
memberName
- to name of the member to check- Returns:
- true if the member exists, false otherwise (security is not checked)
-
getMember
IMendixObjectMember<?> getMember(IContext context, java.lang.String memberName)
Returns the member object with memberName.- Parameters:
context
- the context for accessing the objectmemberName
- the name of the member to get (should exist)- Returns:
- the MendixObjectMember for the given name
-
getId
IMendixIdentifier getId()
Returns the identifier of this object.- Returns:
- the id
-
getState
IMendixObject.ObjectState getState()
Returns the object state of this object.- Returns:
- the object state
-
isChanged
boolean isChanged()
Returns whether at least one member of this object has changed since creation, retrieval or commit.- Returns:
- true if a changed member exists, false otherwise
-
equals
boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
clone
@Deprecated IMendixObject clone() throws java.lang.CloneNotSupportedException
Deprecated.since 9.24. UsecreateClone()
instead.Returns a deep copy of this object.- Returns:
- deep clone of this object
- Throws:
java.lang.CloneNotSupportedException
- when cloning is not supported
-
createClone
IMendixObject createClone()
Returns a deep copy of this object.- Returns:
- deep clone of this object
-
hasChangedByAttribute
boolean hasChangedByAttribute()
Returns whether at least one attribute of this object has changed since creation, retrieval or commit.- Returns:
- true if a changed attribute exists, false otherwise
-
hasChangedDateAttribute
boolean hasChangedDateAttribute()
Returns whether at least one date attribute of this object has changed since creation, retrieval or commit.- Returns:
- true if a changed date attribute exists, false otherwise
-
hasOwnerAttribute
boolean hasOwnerAttribute()
Returns whether at least one owner attribute of this object has changed since creation, retrieval or commit.- Returns:
- true if a changed owner attribute exists, false otherwise
-
getChangedBy
IMendixIdentifier getChangedBy(IContext context) throws CoreException
Returns the Mendix identifier of the last user that changed this object.- Parameters:
context
- the context for accessing the object- Returns:
- the identifier of the last user that changed this object
- Throws:
CoreException
- if hasChangedByAttribute == false
-
getChangedDate
java.util.Date getChangedDate(IContext context) throws CoreException
Returns the last Date that changed in this object.- Parameters:
context
- the context for accessing the object- Returns:
- the last Date that changed
- Throws:
CoreException
- if hasChangedDateAttribute == false
-
getOwner
IMendixIdentifier getOwner(IContext context) throws CoreException
Returns the IMendixIdentifier of the user that owns this object.- Parameters:
context
- the context for accessing the object- Returns:
- the identifier of the owner
- Throws:
CoreException
- if hasOwnerAttribute == false
-
hasCreatedDateAttribute
boolean hasCreatedDateAttribute()
Returns whether this object has a created data attribute.- Returns:
- true if a created date attribute exists, false otherwise
-
getCreatedDate
java.util.Date getCreatedDate(IContext context) throws CoreException
Returns the date/time at which this object was created.- Parameters:
context
- the context for accessing the object- Returns:
- the creation date
- Throws:
CoreException
- if hasCreatedDateAttribute == false
-
hasNullValues
boolean hasNullValues(IContext context)
Returns whether this object contains empty members.- Parameters:
context
- the context for accessing the object- Returns:
- true if an empty member exists, false otherwise
-
getMetaObject
IMetaObject getMetaObject()
Returns the meta object for this object.- Returns:
- the meta object
-
hasDeleteRights
boolean hasDeleteRights(IContext context)
Returns whether this object has delete rights.- Parameters:
context
- the context for accessing the object- Returns:
- true if this object has delete rights, false otherwise
-
isNew
boolean isNew()
Returns whether this object has not been committed yet. Only returns true when this object is explicitly committed. If this object is auto-committed, this method returns false.- Returns:
- true if this object is new, false otherwise
-
isInstanceOf
default boolean isInstanceOf(IMetaObject metaObject)
Returns whether this object is an instance of a given IMetaObject.- Parameters:
metaObject
- instance of the metaObject- Returns:
- true if this object is an instance of the given IMetaObject.
-
isInstanceOf
default boolean isInstanceOf(java.lang.String metaObject)
Returns whether this object is an instance of a given IMetaObject.- Parameters:
metaObject
- name of the metaObjectz- Returns:
- true if this object is an instance of the given IMetaObject
-
-