Class ConverterStorage
java.lang.Object
com.e1c.langtool.internal.converter.db.ConverterStorage
- Direct Known Subclasses:
ResourceIndexConverterStorage,TargetKeyStorage
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 Summary
ConstructorsModifierConstructorDescriptionprotectedConverterStorage(File dbFile) Creates a new instance ofConverterStoragewith the specified database file. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidafterOpenDb(org.mapdb.DB db) After open db.protected voidPerforms tasks before closing the converter storage.protected voidChecks whether the storage is initialized and opens it if necessary.voidclose()Closes the converter storage.voiddelete()Deletes the converter storage.getValues(long id) Gets the converted values for the specified ID.voidopen()Opens the converter storage.putValues(long id, ConvertedValues values) Puts the specified converted values for the given ID.removeValues(long id) Removes the converted values for the specified ID.
-
Constructor Details
-
ConverterStorage
Creates a new instance ofConverterStoragewith the specified database file.- Parameters:
dbFile- the file for the MapDB database, cannot benull.
-
-
Method Details
-
getValues
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
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 benull.- Returns:
- the existing converted values, or
nullif none existed.
-
removeValues
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
nullif 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.
-