Class SamplePrePersistHook
- java.lang.Object
-
- org.junit.rules.ExternalResource
-
- de.hybris.platform.odata2webservices.odata.persistence.hooks.SamplePrePersistHook
-
- All Implemented Interfaces:
PrePersistHook,org.junit.rules.TestRule
public class SamplePrePersistHook extends org.junit.rules.ExternalResource implements PrePersistHook
-
-
Constructor Summary
Constructors Constructor Description SamplePrePersistHook()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafter()java.util.Optional<ItemModel>execute(ItemModel item)Executes this hook before persisting the given item.voidgivenDoesInExecute(java.util.function.Function<ItemModel,java.util.Optional<ItemModel>> function)booleanisExecuted()voidsetHookRegistry(DefaultPersistenceHookRegistry registry)
-
-
-
Method Detail
-
execute
public java.util.Optional<ItemModel> execute(ItemModel item)
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.
-
isExecuted
public boolean isExecuted()
-
givenDoesInExecute
public void givenDoesInExecute(java.util.function.Function<ItemModel,java.util.Optional<ItemModel>> function)
-
after
public void after()
- Overrides:
afterin classorg.junit.rules.ExternalResource
-
setHookRegistry
public void setHookRegistry(DefaultPersistenceHookRegistry registry)
-
-