- java.lang.Object
-
- org.tentackle.session.ModificationEvent
-
- All Implemented Interfaces:
java.io.Serializable
public class ModificationEvent extends java.lang.Object implements java.io.SerializableModification event.Modification events come in three flavors, which is determined by the corresponding
ModificationListener.- master: master modification event for any modification
- named event: a single named modification event (usually a table)
- list of named events: modification for more than one name
- Author:
- harald
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ModificationEvent(Session session, long serial)Creates a modification master event.ModificationEvent(Session session, java.util.Collection<ModificationEventDetail> details)Creates a modification event.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ModificationEventDetailgetDetail(java.lang.String name)Gets the modification detail for a name.java.util.Collection<ModificationEventDetail>getDetails()Gets the modification details.java.lang.StringgetName()Gets the modification name of the first detail.longgetSerial()Gets the modification serial of the first detail or master.SessiongetSession()Gets the session.booleanisMasterEvent()Returns whether this is a master event.
Master events provide no details.booleanisMultiEvent()Returns whether this a multi named event.booleanisSingleEvent()Returns whether this is a named single event.java.lang.StringtoString()
-
-
-
Constructor Detail
-
ModificationEvent
public ModificationEvent(Session session, java.util.Collection<ModificationEventDetail> details)
Creates a modification event.- Parameters:
session- the session, never nulldetails- the modification details, one for each name
-
ModificationEvent
public ModificationEvent(Session session, long serial)
Creates a modification master event.- Parameters:
session- the session, never nullserial- the master modification serial
-
-
Method Detail
-
getSession
public Session getSession()
Gets the session.- Returns:
- the session
-
isMasterEvent
public boolean isMasterEvent()
Returns whether this is a master event.
Master events provide no details.- Returns:
- true if master event
-
isSingleEvent
public boolean isSingleEvent()
Returns whether this is a named single event.- Returns:
- true if single event
-
isMultiEvent
public boolean isMultiEvent()
Returns whether this a multi named event.- Returns:
- true if multi event
-
getSerial
public long getSerial()
Gets the modification serial of the first detail or master.- Returns:
- the serial
-
getName
public java.lang.String getName()
Gets the modification name of the first detail.- Returns:
- the name, null if master event
-
getDetails
public java.util.Collection<ModificationEventDetail> getDetails()
Gets the modification details.- Returns:
- the details, null if master event
-
getDetail
public ModificationEventDetail getDetail(java.lang.String name)
Gets the modification detail for a name.- Parameters:
name- the name- Returns:
- the detail, null if no such detail
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-