Class MemoryDeployment

java.lang.Object
com.developer.nefarious.zjoule.plugin.memory.MemoryDeployment
All Implemented Interfaces:
IMemoryObject<Deployment>

public class MemoryDeployment extends Object implements IMemoryObject<Deployment>
Manages the storage and retrieval of deployment information in memory.

The MemoryDeployment class provides methods to save, load, and check the validity of deployment data stored in Eclipse preferences. It implements IMemoryObject<Deployment>.

  • Field Details

    • KEY

      public static final String KEY
      Key used for storing and retrieving deployment information in memory.
      See Also:
  • Method Details

    • getInstance

      public static MemoryDeployment getInstance()
      Retrieves the singleton instance of MemoryDeployment.
      Returns:
      the singleton instance.
      Throws:
      IllegalStateException - if the instance has not been initialized.
    • initialize

      public static void initialize(IObjectSerializer objectSerializer, IEclipseMemory eclipseMemory)
      Initializes the MemoryDeployment singleton with the specified dependencies.
      Parameters:
      objectSerializer - the serializer for handling object serialization and deserialization.
      eclipseMemory - the manager for Eclipse preferences storage.
    • resetInstance

      public static void resetInstance()
      Resets the singleton instance. Useful for testing or reinitialization.
    • isEmpty

      public Boolean isEmpty()
      Checks if the stored data is empty or invalid.
      Specified by:
      isEmpty in interface IMemoryObject<Deployment>
      Returns:
      true if the stored data is empty or invalid; false otherwise.
    • load

      public Deployment load()
      Loads the data from memory.
      Specified by:
      load in interface IMemoryObject<Deployment>
      Returns:
      the stored object of type T, or null if no data is found or loading fails.
    • save

      public void save(Deployment deployment)
      Saves the given data to memory.
      Specified by:
      save in interface IMemoryObject<Deployment>
      Parameters:
      deployment - the object of type T to save.