# Interface LCommandType<P>

Type Parameters:
  `P` - The type of parameters

All Known Implementing Classes:
  `LCommandAbstract, LCommandCaptionDelete, LCommandCaptionsAdd, LCommandCaptionsModify, LCommandCategoriesAdd, LCommandCategoriesSetRequired, LCommandCategoriesUnsetRequired, LCommandCategoryCaptionsAssign, LCommandCategoryCaptionsUnassign, LCommandCategorySelect, LCommandCompact, LCommandExport, LCommandGlobalCaptionModify, LCommandGlobalCaptionOrderLower, LCommandGlobalCaptionOrderUpper, LCommandGlobalCaptionsAdd, LCommandGlobalCaptionsRemove, LCommandImageCaptionsAssign, LCommandImageCaptionsUnassign, LCommandImagesAdd, LCommandImagesDelete, LCommandImageSelect, LCommandImageSourceSet, LCommandLoad, LCommandMetadataPut, LCommandMetadataRemove, LCommandValidate`

public interface LCommandType<P>
An internal command.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `describe()`
  `LCommandUndoable`
  `execute(LFileModel model, LDatabaseTransactionType transaction, P parameters)`
  Execute the command.
  `default boolean`
  `loading()`
  `void`
  `redo(LFileModel model, LDatabaseTransactionType transaction)`
  Redo the command.
  `default boolean`
  `requiresCompaction()`
  `default byte[]`
  `serialize()`
  Serialize this command as XML properties.
  `Properties`
  `toProperties()`
  `void`
  `undo(LFileModel model, LDatabaseTransactionType transaction)`
  Undo the command.

- ## Method Details

  - ### loading

    default boolean loading()
    Returns:
      `true` if this command indicates the file model is loading

  - ### requiresCompaction

    default boolean requiresCompaction()
    Returns:
      `true` if the database should be compacted after this command

  - ### execute

    LCommandUndoable execute(LFileModel model, LDatabaseTransactionType transaction, P parameters) throws LException, com.io7m.darco.api.DDatabaseException
    Execute the command.
    Parameters:
      `model` - The model
      `transaction` - The database transaction
      `parameters` - The parameters
    Returns:
      A value indicating if the command can be undone
    Throws:
      `LException` - On errors
      `com.io7m.darco.api.DDatabaseException` - On errors

  - ### undo

    void undo(LFileModel model, LDatabaseTransactionType transaction) throws LException, com.io7m.darco.api.DDatabaseException
    Undo the command.
    Parameters:
      `model` - The model
      `transaction` - The database transaction
    Throws:
      `LException` - On errors
      `com.io7m.darco.api.DDatabaseException` - On errors

  - ### redo

    void redo(LFileModel model, LDatabaseTransactionType transaction) throws LException, com.io7m.darco.api.DDatabaseException
    Redo the command.
    Parameters:
      `model` - The model
      `transaction` - The database transaction
    Throws:
      `LException` - On errors
      `com.io7m.darco.api.DDatabaseException` - On errors

  - ### toProperties

    Properties toProperties()
    Returns:
      The command as a set of properties

  - ### describe

    String describe()
    Returns:
      A humanly-readable description of the operation

  - ### serialize

    default byte[] serialize()
    Serialize this command as XML properties.
    Returns:
      The serialized bytes