Package com.helger.phase4.model.pmode
Interface IPModeManager
- All Known Implementing Classes:
PModeManagerInMemory,PModeManagerXML
public interface IPModeManager
Interface for a manager for
PMode objects.- Author:
- Philip Helger
-
Method Summary
Modifier and TypeMethodDescriptionvoidcreateOrUpdatePMode(@NonNull PMode aPMode) Create or update the provided PMode.voidcreatePMode(@NonNull PMode aPMode) Create a new PMode.@NonNull com.helger.base.state.EChangedeletePMode(@Nullable String sPModeID) Delete the provided PMode.@Nullable IPModeFind the first PMode matching the provided filter.@NonNull com.helger.collection.commons.ICommonsList<IPMode> getAll()@NonNull com.helger.collection.commons.ICommonsSet<String> getPModeFilter(@NonNull String sID, @Nullable PModeParty aInitiator, @Nullable PModeParty aResponder) Get a predicate that matches a PMode by ID or initiator and responder together.@Nullable IPModegetPModeOfID(@Nullable String sID) Find the PMode with the provided IDdefault @Nullable IPModegetPModeOfServiceAndAction(@Nullable String sService, @Nullable String sAction) Find the first PMode that has the provided service and action.@NonNull com.helger.base.state.EChangemarkPModeDeleted(@Nullable String sPModeID) Mark the provided PMode as deleted.@NonNull com.helger.base.state.EChangeupdatePMode(@NonNull IPMode aPMode) Update an existing PMode.default voidValidate all contained PModes at once.default voidvalidatePMode(@Nullable 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
default @Nullable 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
static @NonNull Predicate<IPMode> getPModeFilter(@NonNull String sID, @Nullable PModeParty aInitiator, @Nullable PModeParty aResponder) Get a predicate that matches a PMode by ID or initiator and responder together.- 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
@NonNull com.helger.collection.commons.ICommonsList<IPMode> getAll()- Returns:
- A non-
nullbut maybe empty list of all contained PModes.
-
getAllIDs
@NonNull com.helger.collection.commons.ICommonsSet<String> 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
-