Package com.kenshoo.pl.entity.internal
Class DefaultFieldValueEnricher<E extends EntityType<E>,T>
- java.lang.Object
-
- com.kenshoo.pl.entity.internal.DefaultFieldValueEnricher<E,T>
-
- All Implemented Interfaces:
CurrentStateConsumer<E>,PostFetchCommandEnricher<E>
public class DefaultFieldValueEnricher<E extends EntityType<E>,T> extends java.lang.Object implements PostFetchCommandEnricher<E>
Created by yuvalr on 2/1/16.
-
-
Constructor Summary
Constructors Constructor Description DefaultFieldValueEnricher(EntityField<E,T> field, T defaultValue)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidenrich(java.util.Collection<? extends ChangeEntityCommand<E>> changeEntityCommands, ChangeOperation changeOperation, ChangeContext changeContext)"Enriches" the commands with system-imposed changes.java.util.stream.Stream<EntityField<E,?>>fieldsToEnrich()return stream of enriched fields according to input commands.SupportedChangeOperationgetSupportedChangeOperation()booleanshouldRun(java.util.Collection<? extends EntityChange<E>> changeEntityCommands)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.kenshoo.pl.entity.spi.CurrentStateConsumer
requiredFields
-
-
-
-
Constructor Detail
-
DefaultFieldValueEnricher
public DefaultFieldValueEnricher(EntityField<E,T> field, T defaultValue)
-
-
Method Detail
-
enrich
public void enrich(java.util.Collection<? extends ChangeEntityCommand<E>> changeEntityCommands, ChangeOperation changeOperation, ChangeContext changeContext)
Description copied from interface:PostFetchCommandEnricher"Enriches" the commands with system-imposed changes.- Specified by:
enrichin interfacePostFetchCommandEnricher<E extends EntityType<E>>- Parameters:
changeEntityCommands- commands to enrichchangeOperation- operationchangeContext- the context of the operation
-
fieldsToEnrich
public java.util.stream.Stream<EntityField<E,?>> fieldsToEnrich()
Description copied from interface:PostFetchCommandEnricherreturn stream of enriched fields according to input commands.- Specified by:
fieldsToEnrichin interfacePostFetchCommandEnricher<E extends EntityType<E>>- Returns:
- the fields should be enriched
-
shouldRun
public boolean shouldRun(java.util.Collection<? extends EntityChange<E>> changeEntityCommands)
- Specified by:
shouldRunin interfacePostFetchCommandEnricher<E extends EntityType<E>>- Parameters:
changeEntityCommands- to enrich- Returns:
- indicator that enricher should be run
-
getSupportedChangeOperation
public SupportedChangeOperation getSupportedChangeOperation()
- Specified by:
getSupportedChangeOperationin interfaceCurrentStateConsumer<E extends EntityType<E>>
-
-