org.modeshape.jcr.api.observation

## Interface PropertyEvent

- All Superinterfaces:
    Event

      public interface PropertyEvent
      extends Event

  Extension of the `Event` interface allowing clients to retrieve extra information from events generated around properties.
  See Also:
    `Event.PROPERTY_CHANGED`, `Event.PROPERTY_ADDED`, `Event.PROPERTY_REMOVED`

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.modeshape.jcr.api.observation.Event

      `Event.Sequencing`

  - ### Field Summary

    - ### Fields inherited from interface org.modeshape.jcr.api.observation.Event

      `ALL_EVENTS`

    - ### Fields inherited from interface javax.jcr.observation.Event

      `NODE_ADDED, NODE_MOVED, NODE_REMOVED, PERSIST, PROPERTY_ADDED, PROPERTY_CHANGED, PROPERTY_REMOVED`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Object` | `getCurrentValue()` Returns the single value of the property if it's not a multi-value property, or the first value from the list of values if the property is multi-valued.
    `List<?>` | `getCurrentValues()` Returns all the values of the property.
    `Object` | `getPreviousValue()` In case of a `Event.PROPERTY_CHANGED` event, returns the single value of the old property if it wasn't a multi-value property, or the first value from the list of values if the property was multi-valued.
    `List<?>` | `getPreviousValues()` In case of a `Event.PROPERTY_CHANGED` event, returns all the values of the old property.
    `boolean` | `isMultiValue()` Returns `true` if this property is multi-valued and `false` if this property is single-valued.
    `boolean` | `wasMultiValue()` In case of a `Event.PROPERTY_CHANGED` event, returns `true` if the old property was multi-valued and `false` if the old property was single-valued.

    - ### Methods inherited from interface org.modeshape.jcr.api.observation.Event

      `getMixinNodeTypes, getPrimaryNodeType`

    - ### Methods inherited from interface javax.jcr.observation.Event

      `getDate, getIdentifier, getInfo, getPath, getType, getUserData, getUserID`

- - ### Method Detail

    - #### isMultiValue

          boolean isMultiValue()

      Returns `true` if this property is multi-valued and `false` if this property is single-valued.
      Returns:
        whether this property has multiple values or a single value.

    - #### getCurrentValue

          Object getCurrentValue()

      Returns the single value of the property if it's not a multi-value property, or the first value from the list of values if the property is multi-valued.
      Returns:
        a `Object` corresponding to the value of the property or `null` if the property has no value

    - #### getCurrentValues

          List<?> getCurrentValues()

      Returns all the values of the property. If the property is single-valued, it will return a list with 1 element.
      Returns:
        a `List` with all the values of the property, never `null`

    - #### wasMultiValue

          boolean wasMultiValue()

      In case of a `Event.PROPERTY_CHANGED` event, returns `true` if the old property was multi-valued and `false` if the old property was single-valued.

      For all other property events, this will return `false`.
      Returns:
        whether the old property had multiple values or a single value, or `false` if the event type is not `Event.PROPERTY_CHANGED`

    - #### getPreviousValue

          Object getPreviousValue()

      In case of a `Event.PROPERTY_CHANGED` event, returns the single value of the old property if it wasn't a multi-value property, or the first value from the list of values if the property was multi-valued.
      Returns:
        a `Object` corresponding to the value of the old property or `null` if the old property had no value or if the event is not a`Event.PROPERTY_CHANGED` event

    - #### getPreviousValues

          List<?> getPreviousValues()

      In case of a `Event.PROPERTY_CHANGED` event, returns all the values of the old property. If the property was single-valued, it will return a list with 1 element.
      Returns:
        a `List` with all the values of the old property or `null` if the event is not a `Event.PROPERTY_CHANGED` event.

Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.