Package org.apache.cayenne.map

## Class CallbackDescriptor

- java.lang.Object
- - org.apache.cayenne.map.CallbackDescriptor

- All Implemented Interfaces:
    `Serializable`

      public class CallbackDescriptor
      extends Object
      implements Serializable

  A mapping descriptor of a single callback event.
  Since:
    3.0
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected Set<String>` | `callbackMethods` |
    `protected LifecycleEvent` | `callbackType` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `CallbackDescriptor​(LifecycleEvent callbackType)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `addCallbackMethod​(String methodName)` |
    `void` | `clear()` | Removes all callback methods.
    `Collection<String>` | `getCallbackMethods()` | Returns all callback methods for this callback event.
    `LifecycleEvent` | `getCallbackType()` |
    `boolean` | `moveMethod​(String callbackMethod, int destinationIndex)` | Moves specified callback method to the specified position
    `void` | `removeCallbackMethod​(String methodName)` |
    `void` | `setCallbackMethodAt​(int index, String method)` | Replaces a callback method at the specified position

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

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

- - ### Field Detail

    - #### callbackType

          protected LifecycleEvent callbackType

    - #### callbackMethods

          protected Set<String> callbackMethods

  - ### Constructor Detail

    - #### CallbackDescriptor

          public CallbackDescriptor​(LifecycleEvent callbackType)

  - ### Method Detail

    - #### clear

          public void clear()

      Removes all callback methods.

    - #### getCallbackMethods

          public Collection<String> getCallbackMethods()

      Returns all callback methods for this callback event.
      Returns:
        Returns all callback methods

    - #### addCallbackMethod

          public void addCallbackMethod​(String methodName)

    - #### removeCallbackMethod

          public void removeCallbackMethod​(String methodName)

    - #### getCallbackType

          public LifecycleEvent getCallbackType()

    - #### moveMethod

          public boolean moveMethod​(String callbackMethod,
                                    int destinationIndex)

      Moves specified callback method to the specified position
      Parameters:
        `callbackMethod` - callbacm method name (should exist)
        `destinationIndex` - destinationi index (should be valid)
      Returns:
        true if any changes were made

    - #### setCallbackMethodAt

          public void setCallbackMethodAt​(int index,
                                          String method)

      Replaces a callback method at the specified position
      Parameters:
        `index` - callback method index
        `method` - new callback method