Class SamplePrePersistHook
java.lang.Object
org.junit.rules.ExternalResource
de.hybris.platform.odata2webservices.odata.persistence.hooks.SamplePrePersistHook
- All Implemented Interfaces:
PrePersistHook,PrePersistHook,org.junit.rules.TestRule
public class SamplePrePersistHook
extends org.junit.rules.ExternalResource
implements PrePersistHook, PrePersistHook
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidafter()voiddoesInExecute(BiFunction<ItemModel, PersistenceContext, Optional<ItemModel>> function) Executes this hook before persisting the given item.execute(ItemModel item, PersistenceContext context) Executes this hook before persisting the given item.voidgivenDoesInExecute(Function<ItemModel, Optional<ItemModel>> function) booleanvoidMethods inherited from class org.junit.rules.ExternalResource
apply, before
-
Constructor Details
-
SamplePrePersistHook
public SamplePrePersistHook()
-
-
Method Details
-
execute
Description copied from interface:PrePersistHookExecutes this hook before persisting the given item.- Specified by:
executein interfacePrePersistHook- Parameters:
item- an item to execute this hook with.- Returns:
- result of processing/modification of the item by this hook to be persisted. If empty, that means there is no item to persist.
-
execute
Description copied from interface:PrePersistHookExecutes this hook before persisting the given item.- Specified by:
executein interfacePrePersistHook- Parameters:
item- an item to execute this hook with.context- to provide information about the item to be persisted- Returns:
- result of processing/modification of the item by this hook to be persisted. If empty, that means there is no item to persist.
- See Also:
-
isExecuted
public boolean isExecuted() -
givenDoesInExecute
-
doesInExecute
-
after
public void after()- Overrides:
afterin classorg.junit.rules.ExternalResource
-
setHookRegistry
-