Class ConverterStorage

java.lang.Object
com.e1c.langtool.internal.converter.db.ConverterStorage
Direct Known Subclasses:
ResourceIndexConverterStorage, TargetKeyStorage

public abstract class ConverterStorage extends Object
Abstract base class for implementing storage mechanisms used by the IConverterManager.

The ConverterStorage class provides a foundation for managing and persisting conversion data between language projects. It is designed to be extended to implement specific storage solutions.

Usage example:

 // Create a class extending ConverterStorage to implement a specific storage solution
 public class MyConverterStorage extends ConverterStorage {
     // Implement specific methods and functionality for the storage solution

 }

Note: This class provides a framework for managing storage-related tasks and should be extended to implement specific storage mechanisms.

See Also:
  • Constructor Details

    • ConverterStorage

      protected ConverterStorage(File dbFile)
      Creates a new instance of ConverterStorage with the specified database file.
      Parameters:
      dbFile - the file for the MapDB database, cannot be null.
  • Method Details

    • getValues

      public ConvertedValues getValues(long id)
      Gets the converted values for the specified ID.
      Parameters:
      id - the ID for which to retrieve the converted values.
      Returns:
      the converted values, or {@link null} if not found.
    • putValues

      public ConvertedValues putValues(long id, ConvertedValues values)
      Puts the specified converted values for the given ID.
      Parameters:
      id - the ID for which to put the converted values.
      values - the converted values to put, cannot be null.
      Returns:
      the existing converted values, or null if none existed.
    • removeValues

      public ConvertedValues removeValues(long id)
      Removes the converted values for the specified ID.
      Parameters:
      id - the ID for which to remove the converted values.
      Returns:
      the removed converted values, or null if none existed.
    • open

      public void open()
      Opens the converter storage.
    • close

      public void close()
      Closes the converter storage.
    • delete

      public void delete()
      Deletes the converter storage.
    • afterOpenDb

      protected void afterOpenDb(org.mapdb.DB db)
      After open db.
      Parameters:
      db - the db
    • beforeClose

      protected void beforeClose()
      Performs tasks before closing the converter storage.
    • checkOrOpen

      protected void checkOrOpen()
      Checks whether the storage is initialized and opens it if necessary.