Class DBEntry


  • public class DBEntry
    extends Serializer
    Stores an entry for each corresponding argument defined in the DBTable
    • Constructor Summary

      Constructors 
      Constructor Description
      DBEntry​(DBTable table)
      Constructor of the DBEntry
    • Method Summary

      Modifier and Type Method Description
      CheckSum checkSum()
      Get the checksum argument of the entry
      java.util.Optional<java.util.Map<java.lang.String,​java.nio.ByteBuffer>> evaluate​(java.nio.ByteBuffer data)
      Load an Entry from a given ByteBuffer
      java.lang.String file()
      Get the file argument of the entry
      java.util.Optional<java.lang.String> get​(java.lang.String entry)
      Get the entry corresponding to a given name
      java.util.Set<ArgumentValue<java.lang.String>> getIndexedArguments()
      Retrieve a list of all the argument hold by the current entry (see ArgumentValue)
      void load​(java.nio.ByteBuffer data)
      Load the entry from a ByteBuffer
      java.nio.ByteBuffer save()
      Save the entry to a ByteBuffer
      void set​(java.lang.String argumentName, java.lang.String value)
      Set the argument of the entry to a specific value
      void setCheckSum​(CheckSum checkSum)
      Set the checksum of the given entry
      void setFile​(java.lang.String file)
      Sets the file argument of the entry
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DBEntry

        public DBEntry​(DBTable table)
        Constructor of the DBEntry
        Parameters:
        table - the table used to create the argument and value contained in the entry
    • Method Detail

      • checkSum

        public CheckSum checkSum()
        Get the checksum argument of the entry
        Returns:
        The checksum hold by the current entry (see CheckSum)
      • setCheckSum

        public void setCheckSum​(CheckSum checkSum)
        Set the checksum of the given entry
        Parameters:
        checkSum - the new checkSum value (see CheckSum)
      • file

        public java.lang.String file()
        Get the file argument of the entry
        Returns:
        An String that hold the file from which the entry has been loaded
      • setFile

        public void setFile​(java.lang.String file)
        Sets the file argument of the entry
        Parameters:
        file - an String that hold the file from which the current entry has been loaded
      • getIndexedArguments

        public java.util.Set<ArgumentValue<java.lang.String>> getIndexedArguments()
        Retrieve a list of all the argument hold by the current entry (see ArgumentValue)
        Returns:
        A set of argument values
      • get

        public java.util.Optional<java.lang.String> get​(java.lang.String entry)
        Get the entry corresponding to a given name
        Parameters:
        entry - the name of the argument we wanted to retrieve String
        Returns:
        An optional String that hold the result (or empty if the argument doesn't exists in the entry)
      • set

        public void set​(java.lang.String argumentName,
                        java.lang.String value)
        Set the argument of the entry to a specific value
        Parameters:
        argumentName - String that hold the argument we want to change
        value - String the new value hold by the argument
      • evaluate

        public java.util.Optional<java.util.Map<java.lang.String,​java.nio.ByteBuffer>> evaluate​(java.nio.ByteBuffer data)
        Load an Entry from a given ByteBuffer
        Overrides:
        evaluate in class Serializer
        Parameters:
        data - hold an ByteBuffer that will be used to load the data
        Returns:
        An Optional that contains a map of String and ByteBuffer
      • load

        public void load​(java.nio.ByteBuffer data)
        Load the entry from a ByteBuffer
        Parameters:
        data - ByteBuffer that hold the data from which the entry is loaded
      • save

        public java.nio.ByteBuffer save()
        Save the entry to a ByteBuffer
        Returns:
        ByteBuffer that contains an encoded version of the entry (that can be loaded with the load methods)