Class CheckedRawData

java.lang.Object
passwordmanager.encoded.CheckedRawData
All Implemented Interfaces:
Serializable, Cloneable, IRawData, IRecoverable

public class CheckedRawData extends Object implements IRawData
Data structure with encrypted records implementation
Since:
2023-12-14
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private List<String>
    List of encrypted records
    private String
    Name of an encrypted data structure
    private String
    The path along which the structure will be saved
    private static final long
    Class version number for checks when desirializing and serializing class objects
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor that initializes a list of encrypted entries, name structure and the path in which it can be stored
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Method for checking the correctness of the structure with encrypted records
    Method for cloning a structure object with encrypted records
    private void
    Method generating default path for saving and restoring structure
    Method for getting a list of encrypted records from a structure
    Method for getting the name of an encrypted data structure
    Method for obtaining the path along which the structure will be saved
    void
    Method for restoring structure
    void
    Method for saving structure
    void
    setData(List<String> newData)
    Method for changing the list of encrypted entries in a structure
    void
    setName(String newName)
    Method for setting the name of an encrypted data structure
    void
    setPathToSaveFile(String pathToSaveFile)
    Method for changing the path where the structure will be saved

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Class version number for checks when desirializing and serializing class objects
      See Also:
    • data

      private List<String> data
      List of encrypted records
    • name

      private String name
      Name of an encrypted data structure
    • pathToSaveFile

      private String pathToSaveFile
      The path along which the structure will be saved
  • Constructor Details

    • CheckedRawData

      public CheckedRawData()
      Constructor that initializes a list of encrypted entries, name structure and the path in which it can be stored
  • Method Details

    • getData

      public List<String> getData()
      Method for getting a list of encrypted records from a structure
      Specified by:
      getData in interface IRawData
      Returns:
      list of encrypted entries
    • setData

      public void setData(List<String> newData)
      Method for changing the list of encrypted entries in a structure
      Specified by:
      setData in interface IRawData
      Parameters:
      newData - list of encrypted entries
    • checkData

      public boolean checkData()
      Method for checking the correctness of the structure with encrypted records
      Specified by:
      checkData in interface IRawData
      Returns:
      whether the data structure is correct or not
    • getName

      public String getName()
      Method for getting the name of an encrypted data structure
      Specified by:
      getName in interface IRawData
      Returns:
      data structure name
    • setName

      public void setName(String newName)
      Method for setting the name of an encrypted data structure
      Specified by:
      setName in interface IRawData
      Parameters:
      newName - new data structure name
    • save

      public void save()
      Method for saving structure
      Specified by:
      save in interface IRecoverable
    • load

      public void load()
      Method for restoring structure
      Specified by:
      load in interface IRecoverable
    • clone

      public CheckedRawData clone()
      Method for cloning a structure object with encrypted records
      Specified by:
      clone in interface IRawData
      Overrides:
      clone in class Object
      Returns:
      cloned structure
    • getPathToSaveFile

      public String getPathToSaveFile()
      Method for obtaining the path along which the structure will be saved
      Returns:
      path to the saving file
    • setPathToSaveFile

      public void setPathToSaveFile(String pathToSaveFile)
      Method for changing the path where the structure will be saved
      Parameters:
      pathToSaveFile - the path along which the structure will be saved
    • generateSaveFilePath

      private void generateSaveFilePath()
      Method generating default path for saving and restoring structure