Package org.deckfour.xes.extension.std
Class XExtendedEvent
- java.lang.Object
-
- org.deckfour.xes.extension.std.XExtendedEvent
-
- All Implemented Interfaces:
java.lang.Cloneable,XAttributable,XElement,XEvent
public class XExtendedEvent extends java.lang.Object implements XEvent
Helper class. This class can be used to dynamically wrap any event, and provides an extended set of getter and setter methods for typically-available extension attributes.- Author:
- Christian W. Guenther (christian@deckfour.org)
-
-
Constructor Summary
Constructors Constructor Description XExtendedEvent(XEvent original)Constructs a new wrapper object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(XVisitor visitor, XTrace trace)java.lang.Objectclone()Clones this event, i.e.booleanequals(java.lang.Object o)Tests for equality of type and IDXAttributeMapgetAttributes()Retrieves the attributes set for this element.java.util.Set<XExtension>getExtensions()Retrieves the extensions used by this element, i.e.java.lang.StringgetGroup()Returns the group of the event, as defined by the Organizational extension.XIDgetID()Returns the id of the eventjava.lang.StringgetInstance()Retrieves the activity instance of this event, as defined by the Concept extension.java.util.List<java.lang.String>getModelReferences()Returns the list of model references defined for this event, as defined in the Semantic extension.java.util.List<java.net.URI>getModelReferenceURIs()Returns the list of model reference URIs defined for this event, as defined in the Semantic extension.java.lang.StringgetName()Retrieves the activity name of this event, as defined by the Concept extension.java.lang.StringgetResource()Returns the resource of the event, as defined by the Organizational extension.java.lang.StringgetRole()Returns the role of the event, as defined by the Organizational extension.XLifecycleExtension.StandardModelgetStandardTransition()Returns the standard lifecycle transition of the event, as defined by the Lifecycle extension.java.util.DategetTimestamp()Retrieves the timestamp of the event, as defined by the Time extension.java.lang.StringgetTransition()Returns the lifecycle transition of the event, as defined by the Lifecycle extension.booleanhasAttributes()Checks for the existence of attributes.inthashCode()Returns the hashCode of the IDvoidsetAttributes(XAttributeMap attributes)Sets the map of attributes for this element.voidsetGroup(java.lang.String group)Sets the group of the event, as defined by the Organizational extension.voidsetInstance(java.lang.String instance)Sets the activity instance of this event, as defined by the Concept extension.voidsetModelReferences(java.util.List<java.lang.String> modelReferences)Sets the list of model reference strings defined for this event, as defined in the Semantic extension.voidsetModelReferenceURIs(java.util.List<java.net.URI> modelReferenceURIs)Sets the list of model reference URIs defined for this event, as defined in the Semantic extension.voidsetName(java.lang.String name)Sets the activity name of this event, as defined by the Concept extension.voidsetResource(java.lang.String resource)Sets the resource of the event, as defined by the Organizational extension.voidsetRole(java.lang.String role)Sets the role of the event, as defined by the Organizational extension.voidsetStandardTransition(XLifecycleExtension.StandardModel transition)Sets the standard lifecycle transition of the event, as defined by the Lifecycle extension.voidsetTimestamp(long timestamp)Sets the timestamp of the event, as defined by the Time extension.voidsetTimestamp(java.util.Date timestamp)Sets the timestamp of the event, as defined by the Time extension.voidsetTransition(java.lang.String transition)Sets the lifecycle transition of the event, as defined by the Lifecycle extension.static XExtendedEventwrap(XEvent event)Static wrapper method.
-
-
-
Field Detail
-
original
protected XEvent original
The original, wrapped event.
-
-
Constructor Detail
-
XExtendedEvent
public XExtendedEvent(XEvent original)
Constructs a new wrapper object.- Parameters:
original- The original event to be wrapped.
-
-
Method Detail
-
wrap
public static XExtendedEvent wrap(XEvent event)
Static wrapper method. Wraps the given event into an instance of this class, which transparently provides extended access to attributes.- Parameters:
event- The original event to be wrapped.- Returns:
- A wrapped event.
-
getName
public java.lang.String getName()
Retrieves the activity name of this event, as defined by the Concept extension.- Returns:
- Activity name of the event.
-
setName
public void setName(java.lang.String name)
Sets the activity name of this event, as defined by the Concept extension.- Parameters:
name- Activity name of the event.
-
getInstance
public java.lang.String getInstance()
Retrieves the activity instance of this event, as defined by the Concept extension.- Returns:
- Activity instance of the event.
-
setInstance
public void setInstance(java.lang.String instance)
Sets the activity instance of this event, as defined by the Concept extension.- Parameters:
instance- Activity instance of the event.
-
getTimestamp
public java.util.Date getTimestamp()
Retrieves the timestamp of the event, as defined by the Time extension.- Returns:
- Timestamp as Date object, or
nullif not defined.
-
setTimestamp
public void setTimestamp(java.util.Date timestamp)
Sets the timestamp of the event, as defined by the Time extension.- Parameters:
timestamp- Timestamp, as Date, to be set.
-
setTimestamp
public void setTimestamp(long timestamp)
Sets the timestamp of the event, as defined by the Time extension.- Parameters:
timestamp- Timestamp, as long value in milliseconds, to be set.
-
getResource
public java.lang.String getResource()
Returns the resource of the event, as defined by the Organizational extension.- Returns:
- Resource string. Can be
null, if not defined.
-
setResource
public void setResource(java.lang.String resource)
Sets the resource of the event, as defined by the Organizational extension.- Parameters:
resource- Resource string.
-
getRole
public java.lang.String getRole()
Returns the role of the event, as defined by the Organizational extension.- Returns:
- Role string. Can be
null, if not defined.
-
setRole
public void setRole(java.lang.String role)
Sets the role of the event, as defined by the Organizational extension.- Parameters:
role- Role string.
-
getGroup
public java.lang.String getGroup()
Returns the group of the event, as defined by the Organizational extension.- Returns:
- Group string. Can be
null, if not defined.
-
setGroup
public void setGroup(java.lang.String group)
Sets the group of the event, as defined by the Organizational extension.- Parameters:
group- Group string.
-
getTransition
public java.lang.String getTransition()
Returns the lifecycle transition of the event, as defined by the Lifecycle extension.- Returns:
- Lifecycle transition string. Can be
null, if not defined.
-
setTransition
public void setTransition(java.lang.String transition)
Sets the lifecycle transition of the event, as defined by the Lifecycle extension.- Parameters:
transition- Lifecycle transition string.
-
getStandardTransition
public XLifecycleExtension.StandardModel getStandardTransition()
Returns the standard lifecycle transition of the event, as defined by the Lifecycle extension.- Returns:
- Standard lifecycle transition object. Can be
null, if not defined.
-
setStandardTransition
public void setStandardTransition(XLifecycleExtension.StandardModel transition)
Sets the standard lifecycle transition of the event, as defined by the Lifecycle extension.- Parameters:
transition- Standard lifecycle transition object.
-
getModelReferences
public java.util.List<java.lang.String> getModelReferences()
Returns the list of model references defined for this event, as defined in the Semantic extension.- Returns:
- List of model reference strings.
-
setModelReferences
public void setModelReferences(java.util.List<java.lang.String> modelReferences)
Sets the list of model reference strings defined for this event, as defined in the Semantic extension.- Parameters:
modelReferences- List of model reference strings.
-
getModelReferenceURIs
public java.util.List<java.net.URI> getModelReferenceURIs()
Returns the list of model reference URIs defined for this event, as defined in the Semantic extension.- Returns:
- List of model reference URIs.
-
setModelReferenceURIs
public void setModelReferenceURIs(java.util.List<java.net.URI> modelReferenceURIs)
Sets the list of model reference URIs defined for this event, as defined in the Semantic extension.- Parameters:
modelReferenceURIs- List of model reference URIs.
-
getAttributes
public XAttributeMap getAttributes()
Description copied from interface:XAttributableRetrieves the attributes set for this element.- Specified by:
getAttributesin interfaceXAttributable- Returns:
- A map of attributes.
-
getExtensions
public java.util.Set<XExtension> getExtensions()
Description copied from interface:XAttributableRetrieves the extensions used by this element, i.e. the extensions used by all attributes of this element, and the element itself.- Specified by:
getExtensionsin interfaceXAttributable- Returns:
- A set of extensions.
-
setAttributes
public void setAttributes(XAttributeMap attributes)
Description copied from interface:XAttributableSets the map of attributes for this element.- Specified by:
setAttributesin interfaceXAttributable- Parameters:
attributes- A map of attributes.
-
hasAttributes
public boolean hasAttributes()
Description copied from interface:XAttributableChecks for the existence of attributes. This method can be a more efficient way of checking for the existance of attributes than usingXAttributable.getAttributes()in certain situations.- Specified by:
hasAttributesin interfaceXAttributable- Returns:
- whether this element has any attributes
-
clone
public java.lang.Object clone()
Clones this event, i.e. creates a deep copy, but with a new ID, so equals does not hold between this and the clone
-
equals
public boolean equals(java.lang.Object o)
Tests for equality of type and ID- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
Returns the hashCode of the ID- Overrides:
hashCodein classjava.lang.Object
-
-