whenNoLongerMatching

public SubscriptionRequest<S> whenNoLongerMatching<I>(Class<I> idType, Consumer<I> consumer)

Adds a consumer observing the entities which previously matched the subscription criteria, but stopped to do so.

The consumer is fed with the ID of the entity in the use-cases which follow:

  • the value of entity fields is changed, so that the entity state does not pass the subscription filters;
  • entity is deleted;
  • entity is archived.

It is a responsibility of callee to provide a correct type of entity identifiers.

Return

this instance of SubscriptionRequest, for call chaining

Parameters

consumer

the consumer to notify

idType

the type of entity identifiers

<I>

type of entity identifiers, for covariance