Interface ManagedEntity<ID,E>
- Type Parameters:
ID- The type of identifier of the entity.E- The type of the entity.
public interface ManagedEntity<ID,E>
A wrapper around an entity whose lifecycle is being managed by an
Repository.- Since:
- 5.0.0
- Author:
- Allard Buijze
-
Method Summary
Modifier and TypeMethodDescriptionapplyStateChange(UnaryOperator<E> change) Change the current state of the entity using the given {code change} function.entity()The current state of the entity.The identifier of the entity.
-
Method Details
-
identifier
ID identifier()The identifier of the entity.- Returns:
- The identifier of the entity.
-
entity
E entity()The current state of the entity.- Returns:
- The current state of the entity.
-
applyStateChange
Change the current state of the entity using the given {code change} function.- Parameters:
change- The function applying the requested change.- Returns:
- The state of the entity after the change.
-