com.kenshoo.pl.entity.spi.CurrentStateConsumer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of persistence-layer Show documentation
Show all versions of persistence-layer Show documentation
A Java persistence layer based on JOOQ for high performance and business flow support.
package com.kenshoo.pl.entity.spi;
import com.kenshoo.pl.entity.*;
import java.util.Collection;
import java.util.function.Predicate;
import java.util.stream.Stream;
/**
* This interface is implemented by pluggable components that require the current state of entities. For instance, a validator
* that needs a profile ID of an currentState, would indirectly implement this interface.
* Client classes should not implement this interface directly, it is used internally by the framework.
*/
public interface CurrentStateConsumer> {
default SupportedChangeOperation getSupportedChangeOperation() {
return SupportedChangeOperation.CREATE_UPDATE_AND_DELETE;
}
default Stream extends EntityField, ?>> requiredFields(Collection extends EntityField> fieldsToUpdate, ChangeOperation changeOperation) {
return Stream.empty();
}
static > Predicate> supporting(ChangeOperation op) {
return consumer -> consumer.getSupportedChangeOperation().supports(op);
}
static > Predicate supporting(CurrentStateConsumer consumer) {
return op -> consumer.getSupportedChangeOperation().supports(op);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy