Package com.thingworx.entities
Class EntityReference
java.lang.Object
com.thingworx.entities.EntityReference
- All Implemented Interfaces:
Comparable<EntityReference>
- Direct Known Subclasses:
SecurityContext
@ThingworxExtensionApiClass(since={6,6},
canInstantiate=true)
public class EntityReference
extends Object
implements Comparable<EntityReference>
A class meant to be a slimmed down way of passing around a reference to an Entity. It contains the minimal amount of information needed
to look up the Entity if inflation is necessary. This class should be used when passing around the fully inflated Entity Instance is not
necessary.
-
Constructor Summary
ConstructorDescriptionEntityReference
(RootEntity entity) EntityReference
(String name, short code) EntityReference
(String name, String type) -
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(EntityReference that) static EntityReference
getName()
Returns the entity object referenced by the name and type.getType()
boolean
matches
(EntityReference entityReference) toString()
-
Constructor Details
-
EntityReference
-
EntityReference
-
EntityReference
@ThingworxExtensionApiMethod(since={6,6}) public EntityReference(String name, RelationshipTypes.ThingworxRelationshipTypes type) -
EntityReference
-
EntityReference
-
-
Method Details
-
getType
@ThingworxExtensionApiMethod(since={6,6}) public RelationshipTypes.ThingworxRelationshipTypes getType() -
getName
-
getReference
Returns the entity object referenced by the name and type. Visibility permissions to the entity will be checked.- Returns:
- the referenced RootEntity or null if the entity does not exist or the current user does not have visibility to that entity.
-
getEntityName
-
getSubEntityName
Get the sub entity from the full name set in thisEntityReference
. Organizations names are typically found to have the organizational unit appended on the end.- Returns:
- the sub entity name, or null if one was not found
-
getDescription
-
findByName
@ThingworxExtensionApiMethod(since={6,6}) public static EntityReference findByName(String name, RelationshipTypes.ThingworxRelationshipTypes type) throws Exception - Throws:
Exception
- If an error occurs
-
matches
-
toString
-
compareTo
- Specified by:
compareTo
in interfaceComparable<EntityReference>
-