Package com.helger.phase4.model.pmode
Interface IPModeManager
- All Known Implementing Classes:
PModeManager,PModeManagerInMemory
public interface IPModeManager
Interface for a manager for
PMode objects.- Author:
- Philip Helger
-
Method Summary
Modifier and TypeMethodDescriptionvoidcreateOrUpdatePMode(PMode aPMode) Create or update the provided PMode.voidcreatePMode(PMode aPMode) Create a new PMode.com.helger.commons.state.EChangedeletePMode(String sPModeID) Delete the provided PMode.Find the first PMode matching the provided filter.com.helger.commons.collection.impl.ICommonsList<IPMode>getAll()com.helger.commons.collection.impl.ICommonsSet<String>getPModeFilter(String sID, PModeParty aInitiator, PModeParty aResponder) Get a predicate that matches a PMode by ID, initiator and responder.getPModeOfID(String sID) Find the PMode with the provided IDdefault IPModegetPModeOfServiceAndAction(String sService, String sAction) Find the first PMode that has the provided service and action.com.helger.commons.state.EChangemarkPModeDeleted(String sPModeID) Mark the provided PMode as deleted.com.helger.commons.state.EChangeupdatePMode(IPMode aPMode) Update an existing PMode.default voidValidate all contained PModes at once.default voidvalidatePMode(IPMode aPMode) Validate, that the provided PMode domain object is consistent according to the underlying requirements.
-
Method Details
-
createPMode
Create a new PMode.- Parameters:
aPMode- The PMode to be created. May not benull.
-
updatePMode
Update an existing PMode.- Parameters:
aPMode- The PMode to be updated. May not benull.- Returns:
EChange.CHANGEDif something changed,EChange.UNCHANGEDotherwise.
-
createOrUpdatePMode
Create or update the provided PMode.- Parameters:
aPMode- The PMode to be created or updated.
-
markPModeDeleted
Mark the provided PMode as deleted.- Parameters:
sPModeID- The ID of the PMode to be marked as deleted. May benull.- Returns:
EChange
-
deletePMode
Delete the provided PMode.- Parameters:
sPModeID- The ID of the PMode to be deleted. May benull.- Returns:
EChange
-
findFirst
Find the first PMode matching the provided filter.- Parameters:
aFilter- The filter to be used. May not benull.- Returns:
nullif no such PMode exists.
-
getPModeOfServiceAndAction
@Nullable default IPMode getPModeOfServiceAndAction(@Nullable String sService, @Nullable String sAction) Find the first PMode that has the provided service and action.- Parameters:
sService- The service to be searched. May benull.sAction- The action to be searched. May benull.- Returns:
nullif no such PMode exists.
-
getPModeFilter
@Nonnull static Predicate<IPMode> getPModeFilter(@Nonnull String sID, @Nullable PModeParty aInitiator, @Nullable PModeParty aResponder) Get a predicate that matches a PMode by ID, initiator and responder.- Parameters:
sID- PMode ID to search. May benull.aInitiator- Initiator to search. May benull.aResponder- Responder to search. May benull.- Returns:
- Never
null.
-
getPModeOfID
Find the PMode with the provided ID- Parameters:
sID- The ID to search. May benull.- Returns:
nullif no such PMode exists.
-
getAll
- Returns:
- A non-
nullbut maybe empty list of all contained PModes.
-
getAllIDs
- Returns:
- A non-
nullbut maybe empty set of the IDs of all contained PModes.
-
validatePMode
Validate, that the provided PMode domain object is consistent according to the underlying requirements.- Parameters:
aPMode- The PMode to be validated. May benull.- Throws:
PModeValidationException- in case the PMode is invalid.
-
validateAllPModes
Validate all contained PModes at once.- Throws:
PModeValidationException- In case at least one PMode is invalid
-