Interface DataContainerDbWriter<T extends DataContainer & DatabaseIDHandler>

    • Method Detail

      • getDataProvider

        DataProvider<T> getDataProvider​(T cont)
        Returns the data provider to use for storing the container in the database.
        Parameters:
        cont - the current container
        Returns:
        the data provider
      • exists

        boolean exists​(DataProvider provider,
                       T cont)
        Returns whether the container already exists in the database.
        Parameters:
        provider - the provider to use for checking
        cont - the container to look for
        Returns:
        true if already stored in database
      • remove

        boolean remove​(DataProvider provider,
                       T cont)
        Removes the container from the database.
        Parameters:
        provider - the provider to use for removing
        cont - the container to remove
        Returns:
        true if successfully removed
      • add

        Integer add​(DataProvider provider,
                    T cont)
        Adds the container to the database.
        Parameters:
        provider - the provider to use
        cont - the container to store
        Returns:
        the database ID, Constants.NO_ID if failed
      • load

        T load​(DataProvider provider,
               T cont)
        Loads the container from the database.
        Parameters:
        provider - the provider to use
        cont - the container to store
        Returns:
        the container, null if failed to load