com.streambase.liveview.client

## Class TupleUpdatedEvent

- java.lang.Object
- - java.util.EventObject
  - - com.streambase.liveview.client.AbstractQueryEvent
    - - com.streambase.liveview.client.AbstractTupleEvent
      - - com.streambase.liveview.client.TupleUpdatedEvent

- All Implemented Interfaces:
    Serializable

      public final class TupleUpdatedEvent
      extends AbstractTupleEvent

  The event dispatched when an existing Tuple is updated. The method `TupleUpdatedEvent.getOld()` will return null unless the event was propagated from a `LiveResult`. The `LiveResult` will propagate the old tuple since it maintains a local copy of all tuples in the query result.
  See Also:
    Serialized Form

- - ### Field Summary

    - ### Fields inherited from class com.streambase.liveview.client.AbstractTupleEvent

      `keyData, tuple`

    - ### Fields inherited from class java.util.EventObject

      `source`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TupleUpdatedEvent(Object source, Long key, Tuple oldTuple, Tuple newTuple, List<Schema.Field> changedFields)` Deprecated.
    `TupleUpdatedEvent(Object source, Long oldKey, Tuple oldTuple, Tuple newTuple, Tuple keyData, List<Schema.Field> changedFields, List<TupleFieldComparator> fieldComparators)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `dispatch(QueryListener listener)` Dispatches this event to the listener
    `List<Schema.Field>` | `getChangedFields()` Retrieve a list of the fields that changed in this update
    `Tuple` | `getOld()` Retrieve the old version of the tuple.
    `boolean` | `hasOld()` See if the old tuple was included in this event

    - ### Methods inherited from class com.streambase.liveview.client.AbstractTupleEvent

      `getComparators, getKey, getKeyValue, getTuple, setKey`

    - ### Methods inherited from class java.util.EventObject

      `getSource, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### TupleUpdatedEvent

          public TupleUpdatedEvent(Object source,
                                   Long key,
                                   Tuple oldTuple,
                                   Tuple newTuple,
                                   List<Schema.Field> changedFields)

      Deprecated.
      Parameters:
        `source` - the source of the event
        `key` - the unique key of the tuple
        `oldTuple` - the old tuple (may be null)
        `newTuple` - the updated tuple
        `changedFields` - the list of changed fields

    - #### TupleUpdatedEvent

          public TupleUpdatedEvent(Object source,
                                   Long oldKey,
                                   Tuple oldTuple,
                                   Tuple newTuple,
                                   Tuple keyData,
                                   List<Schema.Field> changedFields,
                                   List<TupleFieldComparator> fieldComparators)

      Parameters:
        `source` - the source of the event
        `oldKey` - the unique key of the tuple
        `oldTuple` - the old tuple (may be null)
        `newTuple` - the updated tuple
        `keyData` - The data for the full key. May be null only if oldKey is not 0.
        `changedFields` - the list of changed fields
        `fieldComparators` - The pre-built set of comparators for comparing complex keys. May be null only if oldKey is not 0.

  - ### Method Detail

    - #### getOld

          public Tuple getOld()

      Retrieve the old version of the tuple. This will return null in all cases unless it is being propagated from a `LiveResult`
      Returns:
        The old tuple

    - #### hasOld

          public boolean hasOld()

      See if the old tuple was included in this event
      Returns:
        true if old tuple is not null

    - #### getChangedFields

          public List<Schema.Field> getChangedFields()

      Retrieve a list of the fields that changed in this update
      Returns:
        field list of changed fields

    - #### dispatch

          public void dispatch(QueryListener listener)

      Dispatches this event to the listener
      Specified by:
        `dispatch` in class `AbstractQueryEvent`
      Parameters:
        `listener` - the query listener

Copyright © 2015–2018 Cloud Software Group, Inc.. All rights reserved.