Class PModeManagerInMemory

java.lang.Object
com.helger.phase4.model.pmode.PModeManagerInMemory
All Implemented Interfaces:
IPModeManager

@ThreadSafe public class PModeManagerInMemory extends Object implements IPModeManager
Persisting manager for PMode objects.
Author:
Philip Helger
  • Constructor Details

    • PModeManagerInMemory

      public PModeManagerInMemory()
  • Method Details

    • createPMode

      public void createPMode(@Nonnull PMode aPMode)
      Description copied from interface: IPModeManager
      Create a new PMode.
      Specified by:
      createPMode in interface IPModeManager
      Parameters:
      aPMode - The PMode to be created. May not be null.
    • updatePMode

      @Nonnull public com.helger.commons.state.EChange updatePMode(@Nonnull IPMode aNewPMode)
      Description copied from interface: IPModeManager
      Update an existing PMode.
      Specified by:
      updatePMode in interface IPModeManager
      Parameters:
      aNewPMode - The PMode to be updated. May not be null.
      Returns:
      EChange.CHANGED if something changed, EChange.UNCHANGED otherwise.
    • createOrUpdatePMode

      public void createOrUpdatePMode(@Nonnull PMode aPMode)
      Description copied from interface: IPModeManager
      Create or update the provided PMode.
      Specified by:
      createOrUpdatePMode in interface IPModeManager
      Parameters:
      aPMode - The PMode to be created or updated.
    • markPModeDeleted

      @Nonnull public com.helger.commons.state.EChange markPModeDeleted(@Nullable String sPModeID)
      Description copied from interface: IPModeManager
      Mark the provided PMode as deleted.
      Specified by:
      markPModeDeleted in interface IPModeManager
      Parameters:
      sPModeID - The ID of the PMode to be marked as deleted. May be null.
      Returns:
      EChange
    • deletePMode

      @Nonnull public com.helger.commons.state.EChange deletePMode(@Nullable String sPModeID)
      Description copied from interface: IPModeManager
      Delete the provided PMode.
      Specified by:
      deletePMode in interface IPModeManager
      Parameters:
      sPModeID - The ID of the PMode to be deleted. May be null.
      Returns:
      EChange
    • getPModeOfID

      @Nullable public IPMode getPModeOfID(@Nullable String sID)
      Description copied from interface: IPModeManager
      Find the PMode with the provided ID
      Specified by:
      getPModeOfID in interface IPModeManager
      Parameters:
      sID - The ID to search. May be null.
      Returns:
      null if no such PMode exists.
    • findFirst

      @Nullable public IPMode findFirst(@Nonnull Predicate<? super IPMode> aFilter)
      Description copied from interface: IPModeManager
      Find the first PMode matching the provided filter.
      Specified by:
      findFirst in interface IPModeManager
      Parameters:
      aFilter - The filter to be used. May not be null.
      Returns:
      null if no such PMode exists.
    • getAll

      @Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsList<IPMode> getAll()
      Specified by:
      getAll in interface IPModeManager
      Returns:
      A non-null but maybe empty list of all contained PModes.
    • getAllIDs

      @Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsSet<String> getAllIDs()
      Specified by:
      getAllIDs in interface IPModeManager
      Returns:
      A non-null but maybe empty set of the IDs of all contained PModes.