T
- type for which the notifications are preparedpublic abstract class NotificationSupport<T> extends TypeSupport<T>
Constructor and Description |
---|
NotificationSupport(Class<T> clazz)
Creates a new notification type support.
|
Modifier and Type | Method and Description |
---|---|
static <T> NotificationSupport<T> |
findNotificationSupportFor(T newValue)
Retrieves the notification support based on the given value.
|
static <T> NotificationSupport<T> |
immutableTypeSupport(Class<T> clazz)
Support for notification of immutable types.
|
static <T> Notification<T> |
notification(T oldValue,
T newValue)
Returns the final value by using the appropriate type support.
|
abstract Notification<T> |
prepareNotification(T oldValue,
T newValue)
Given the old and new value, prepare the final value that will be notified.
|
addTypeSupport, findTypeSupportFor, getType, getTypeSupportFamily, isTypeDirectlySupported, isTypeSupported, typeSupportsFor
public static <T> Notification<T> notification(T oldValue, T newValue)
T
- the type of the valueoldValue
- the oldValue, which was previously in the previous notificationnewValue
- the newValue, which was computed during the scanningpublic static <T> NotificationSupport<T> findNotificationSupportFor(T newValue)
If no support is found, an exception is thrown.
T
- value typenewValue
- the value; can't be nullpublic abstract Notification<T> prepareNotification(T oldValue, T newValue)
oldValue
- the oldValue, which was previously in the previous notificationnewValue
- the newValue, which was computed during the scanningpublic static <T> NotificationSupport<T> immutableTypeSupport(Class<T> clazz)
Object.equals(java.lang.Object)
.T
- type for which to add supportclazz
- type for which to add supportCopyright © 2010–2015. All rights reserved.