org.eclipse.emf.emfstore.internal.common.model.util
Class NotificationInfo

java.lang.Object
  extended by org.eclipse.emf.emfstore.internal.common.model.util.NotificationInfo
All Implemented Interfaces:
org.eclipse.emf.common.notify.Notification, APIDelegate<ESNotificationInfo>

public class NotificationInfo
extends Object
implements org.eclipse.emf.common.notify.Notification, APIDelegate<ESNotificationInfo>

NotificationInfo is a type safe wrapper for EMF Notifications. It wraps a org.eclipse.emf.common.notify.Notification and implements a few additional getter methods

Author:
chodnick

Field Summary
 
Fields inherited from interface org.eclipse.emf.common.notify.Notification
ADD, ADD_MANY, CREATE, EVENT_TYPE_COUNT, MOVE, NO_FEATURE_ID, NO_INDEX, REMOVE, REMOVE_MANY, REMOVING_ADAPTER, RESOLVE, SET, UNSET
 
Constructor Summary
NotificationInfo(org.eclipse.emf.common.notify.Notification n)
          The constructor needs the notification to wrap.
 
Method Summary
 ESNotificationInfo createAPI()
          Creates the API interface for this class.
 org.eclipse.emf.ecore.EAttribute getAttribute()
           
 String getDebugString()
           
 int getEventType()
           
 Object getFeature()
           
 int getFeatureID(Class<?> expectedClass)
           
 boolean getNewBooleanValue()
           
 byte getNewByteValue()
           
 char getNewCharValue()
           
 double getNewDoubleValue()
           
 float getNewFloatValue()
           
 int getNewIntValue()
           
 long getNewLongValue()
           
 org.eclipse.emf.ecore.EObject getNewModelElementValue()
           
 short getNewShortValue()
           
 String getNewStringValue()
           
 Object getNewValue()
           
 Class<? extends org.eclipse.emf.common.notify.Notification> getNotificationType()
          Returns the type of the Notification.
 Object getNotifier()
           
 org.eclipse.emf.ecore.EObject getNotifierModelElement()
           
 boolean getOldBooleanValue()
           
 byte getOldByteValue()
           
 char getOldCharValue()
           
 double getOldDoubleValue()
           
 float getOldFloatValue()
           
 int getOldIntValue()
           
 long getOldLongValue()
           
 org.eclipse.emf.ecore.EObject getOldModelElementValue()
           
 short getOldShortValue()
           
 String getOldStringValue()
           
 Object getOldValue()
           
 int getPosition()
           
 org.eclipse.emf.ecore.EReference getReference()
           
 org.eclipse.emf.ecore.EStructuralFeature getStructuralFeature()
           
 String getValidationMessage()
           
 boolean hasNext()
           
 boolean isAddEvent()
           
 boolean isAddManyEvent()
           
 boolean isAttributeNotification()
           
 boolean isMoveEvent()
           
 boolean isReferenceNotification()
           
 boolean isRemoveEvent()
           
 boolean isRemoveManyEvent()
           
 boolean isReset()
           
 boolean isSetEvent()
           
 boolean isTouch()
           
 boolean isTransient()
           
 boolean isValid()
           
 boolean merge(org.eclipse.emf.common.notify.Notification notification)
           
 ESNotificationInfo toAPI()
          Returns the API interface of this class.
 String toString()
           
 boolean wasSet()
          
 boolean wasUnset()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NotificationInfo

public NotificationInfo(org.eclipse.emf.common.notify.Notification n)
The constructor needs the notification to wrap.

Parameters:
n - the notification to wrap
Method Detail

getStructuralFeature

public org.eclipse.emf.ecore.EStructuralFeature getStructuralFeature()
Returns:
the structural feature affected

isValid

public boolean isValid()
Returns:
the valid

getValidationMessage

public String getValidationMessage()
Returns:
the validationMessage

isAttributeNotification

public boolean isAttributeNotification()
Returns:
whether this notification signals a change of an attribute value

isReferenceNotification

public boolean isReferenceNotification()
Returns:
whether this notification signals a change of a reference value

getAttribute

public org.eclipse.emf.ecore.EAttribute getAttribute()
Returns:
the EAttribute if the notification relates to an attribute, null otherwise

getReference

public org.eclipse.emf.ecore.EReference getReference()
Returns:
the EReference if the notification relates to a reference feature, null otherwise

isTransient

public boolean isTransient()
Returns:
true if the changed feature is marked transient, false otherwise

isAddEvent

public boolean isAddEvent()
Returns:
true if the event is of type Notification.ADD, false otherwise

isRemoveEvent

public boolean isRemoveEvent()
Returns:
true if the event is of type Notification.REMOVE, false otherwise

isSetEvent

public boolean isSetEvent()
Returns:
true if the event is of type Notification.SET, false otherwise

isAddManyEvent

public boolean isAddManyEvent()
Returns:
true if the event is of type Notification.ADD_MANY, false otherwise

isRemoveManyEvent

public boolean isRemoveManyEvent()
Returns:
true if the event is of type Notification.REMOVE_MANY, false otherwise

isMoveEvent

public boolean isMoveEvent()
Returns:
true if the event is of type Notification.MOVE, false otherwise

hasNext

public boolean hasNext()
Returns:
true if this notification is followed by more notifications in a chain, false if this is the last notification of a chain

getEventType

public int getEventType()
Specified by:
getEventType in interface org.eclipse.emf.common.notify.Notification
Returns:
@see org.eclipse.emf.common.notify.Notification#getEventType()

getFeature

public Object getFeature()
Specified by:
getFeature in interface org.eclipse.emf.common.notify.Notification
Returns:
@see org.eclipse.emf.common.notify.Notification#getFeature()

getFeatureID

public int getFeatureID(Class<?> expectedClass)
Specified by:
getFeatureID in interface org.eclipse.emf.common.notify.Notification
Parameters:
expectedClass - @see org.eclipse.emf.common.notify.Notification#getFeatureID(java.lang.Class)
Returns:
@see org.eclipse.emf.common.notify.Notification#getFeatureID(java.lang.Class)

getNewBooleanValue

public boolean getNewBooleanValue()
Specified by:
getNewBooleanValue in interface org.eclipse.emf.common.notify.Notification
Returns:
@see org.eclipse.emf.common.notify.Notification#getNewBooleanValue()

getNewByteValue

public byte getNewByteValue()
Specified by:
getNewByteValue in interface org.eclipse.emf.common.notify.Notification
Returns:
@see org.eclipse.emf.common.notify.Notification#getNewByteValue()

getNewCharValue

public char getNewCharValue()
Specified by:
getNewCharValue in interface org.eclipse.emf.common.notify.Notification
Returns:
@see org.eclipse.emf.common.notify.Notification#getNewCharValue()

getNewDoubleValue

public double getNewDoubleValue()
Specified by:
getNewDoubleValue in interface org.eclipse.emf.common.notify.Notification
Returns:
@see org.eclipse.emf.common.notify.Notification#getNewDoubleValue()

getNewFloatValue

public float getNewFloatValue()
Specified by:
getNewFloatValue in interface org.eclipse.emf.common.notify.Notification
Returns:
@see org.eclipse.emf.common.notify.Notification#getNewFloatValue()

getNewIntValue

public int getNewIntValue()
Specified by:
getNewIntValue in interface org.eclipse.emf.common.notify.Notification
Returns:
@see org.eclipse.emf.common.notify.Notification#getNewIntValue()

getNewLongValue

public long getNewLongValue()
Specified by:
getNewLongValue in interface org.eclipse.emf.common.notify.Notification
Returns:
@see org.eclipse.emf.common.notify.Notification#getNewLongValue()

getNewShortValue

public short getNewShortValue()
Specified by:
getNewShortValue in interface org.eclipse.emf.common.notify.Notification
Returns:
@see org.eclipse.emf.common.notify.Notification#getNewShortValue()

getNewStringValue

public String getNewStringValue()
Specified by:
getNewStringValue in interface org.eclipse.emf.common.notify.Notification
Returns:
@see org.eclipse.emf.common.notify.Notification#getNewStringValue()

getNewValue

public Object getNewValue()
Specified by:
getNewValue in interface org.eclipse.emf.common.notify.Notification
Returns:
@see org.eclipse.emf.common.notify.Notification#getNewValue()

getNewModelElementValue

public org.eclipse.emf.ecore.EObject getNewModelElementValue()
Returns:
@see org.eclipse.emf.common.notify.Notification#getNewValue()

getNotifier

public Object getNotifier()
Specified by:
getNotifier in interface org.eclipse.emf.common.notify.Notification
Returns:
@see org.eclipse.emf.common.notify.Notification#getNotifier()

getOldBooleanValue

public boolean getOldBooleanValue()
Specified by:
getOldBooleanValue in interface org.eclipse.emf.common.notify.Notification
Returns:
@see org.eclipse.emf.common.notify.Notification#getOldBooleanValue()

getOldByteValue

public byte getOldByteValue()
Specified by:
getOldByteValue in interface org.eclipse.emf.common.notify.Notification
Returns:
@see org.eclipse.emf.common.notify.Notification#getOldByteValue()

getOldCharValue

public char getOldCharValue()
Specified by:
getOldCharValue in interface org.eclipse.emf.common.notify.Notification
Returns:
@see org.eclipse.emf.common.notify.Notification#getOldCharValue()

getOldDoubleValue

public double getOldDoubleValue()
Specified by:
getOldDoubleValue in interface org.eclipse.emf.common.notify.Notification
Returns:
@see org.eclipse.emf.common.notify.Notification#getOldDoubleValue()

getOldFloatValue

public float getOldFloatValue()
Specified by:
getOldFloatValue in interface org.eclipse.emf.common.notify.Notification
Returns:
@see org.eclipse.emf.common.notify.Notification#getOldFloatValue()

getOldIntValue

public int getOldIntValue()
Specified by:
getOldIntValue in interface org.eclipse.emf.common.notify.Notification
Returns:
@see org.eclipse.emf.common.notify.Notification#getOldIntValue()

getOldLongValue

public long getOldLongValue()
Specified by:
getOldLongValue in interface org.eclipse.emf.common.notify.Notification
Returns:
@see org.eclipse.emf.common.notify.Notification#getOldLongValue()

getOldShortValue

public short getOldShortValue()
Specified by:
getOldShortValue in interface org.eclipse.emf.common.notify.Notification
Returns:
@see org.eclipse.emf.common.notify.Notification#getOldShortValue()

getOldStringValue

public String getOldStringValue()
Specified by:
getOldStringValue in interface org.eclipse.emf.common.notify.Notification
Returns:
@see org.eclipse.emf.common.notify.Notification#getOldStringValue()

getOldValue

public Object getOldValue()
Specified by:
getOldValue in interface org.eclipse.emf.common.notify.Notification
Returns:
@see org.eclipse.emf.common.notify.Notification#getOldValue()

getOldModelElementValue

public org.eclipse.emf.ecore.EObject getOldModelElementValue()
Returns:
@see org.eclipse.emf.common.notify.Notification#getOldValue()

getPosition

public int getPosition()
Specified by:
getPosition in interface org.eclipse.emf.common.notify.Notification
Returns:
@see org.eclipse.emf.common.notify.Notification#getPosition()

isReset

public boolean isReset()
Specified by:
isReset in interface org.eclipse.emf.common.notify.Notification
Returns:
@see org.eclipse.emf.common.notify.Notification#isReset()

isTouch

public boolean isTouch()
Specified by:
isTouch in interface org.eclipse.emf.common.notify.Notification
Returns:
@see org.eclipse.emf.common.notify.Notification#isTouch()

merge

public boolean merge(org.eclipse.emf.common.notify.Notification notification)
Specified by:
merge in interface org.eclipse.emf.common.notify.Notification
Parameters:
notification - @see org.eclipse.emf.common.notify.Notification#merge(org.eclipse.emf.common.notify.Notification)
Returns:
@see org.eclipse.emf.common.notify.Notification#merge(org.eclipse.emf.common.notify.Notification)

wasUnset

public boolean wasUnset()
Returns:
true if the feature is unsetable and was in the set state before this notification.

toString

public String toString()
Overrides:
toString in class Object
Returns:
@see java.lang.Object#toString()

getNotifierModelElement

public org.eclipse.emf.ecore.EObject getNotifierModelElement()
Returns:
@see org.eclipse.emf.common.notify.Notification#getNotifier()

getDebugString

public String getDebugString()
Returns:
a string useful for debugging only

getNotificationType

public Class<? extends org.eclipse.emf.common.notify.Notification> getNotificationType()
Returns the type of the Notification.

Returns:
a Notification type

toAPI

public ESNotificationInfo toAPI()
Returns the API interface of this class.

Specified by:
toAPI in interface APIDelegate<ESNotificationInfo>
Returns:
the API interface of this class
See Also:
APIDelegate.toAPI()

createAPI

public ESNotificationInfo createAPI()
Creates the API interface for this class.

Specified by:
createAPI in interface APIDelegate<ESNotificationInfo>
Returns:
the API interface of this class
See Also:
APIDelegate.createAPI()

wasSet

public boolean wasSet()

Specified by:
wasSet in interface org.eclipse.emf.common.notify.Notification
See Also:
Notification.wasSet()


Copyright © 2015. All Rights Reserved.