Annotation Interface Move


@Target(METHOD) @Retention(RUNTIME) public @interface Move
Marks a method as one which moves a resource to a new parent, or that renames it, or both

Return type - void

Input parameters:

  • source object
  • destination parent (as POJO) - might be same as current parent, indicating no change
  • newName - might be same as current name, indicating no change

Example:

  @Move
    public void move(MyDatabase.AbstractContentItem source, MyDatabase.FolderContentItem newParent, String newName) {
        source.moveTo(newParent);
        source.setName(newName);
    }