Entity

public class Entity<T extends EntityState> extends AbstractEntity<I, S>

Stores data associated with a tenant ID.

Parameters

<T>

the type of the data associated with the tenant ID

Constructors

Link copied to clipboard
protected void TenantRepository.Entity(TenantId id)
protected void TenantRepository.Entity(TenantId id, Function<TenantId, T> defaultState)

Inherited properties

Link copied to clipboard
public volatile LifecycleFlags lifecycleFlags
The lifecycle flags of the entity.

Inherited functions

Link copied to clipboard
public void afterInvoke(HandlerMethod<? extends Object, ? extends Object, ? extends Object, ? extends Object> method)
A callback for a handler method invocation end.
Link copied to clipboard
public final Api at(Level logLevel)
Obtains a new fluent logging API at the given level.
Link copied to clipboard
public void beforeInvoke(HandlerMethod<? extends Object, ? extends Object, ? extends Object, ? extends Object> method)
A callback for a handler method invocation start.
Link copied to clipboard
protected final List<ConstraintViolation> checkEntityState(S newState)
Verifies the new entity state and returns ConstraintViolations, if any.
Link copied to clipboard
protected void checkNotArchived()
Ensures that the entity is not marked as archived.
Link copied to clipboard
protected void checkNotDeleted()
Ensures that the entity is not marked as deleted.
Link copied to clipboard
protected final S defaultState()
Obtains the default state of the entity.
Link copied to clipboard
protected void ensureAccessToState()
Ensures that the callee is allowed to access Entity's state() method.
Link copied to clipboard
public boolean equals(Object o)
Link copied to clipboard
public LifecycleFlags getLifecycleFlags()
Obtains current lifecycle flags.
Link copied to clipboard
public int hashCode()
Link copied to clipboard
public I id()
Obtains the identifier of the entity.
Link copied to clipboard
public String idAsString()
Obtains ID of the entity in the string form.
Link copied to clipboard
public boolean isActive()
Verifies if any of the lifecycle attributes is set.
Link copied to clipboard
public final boolean isArchived()
Tests whether the entity is marked as archived.
Link copied to clipboard
public final boolean isDeleted()
Tests whether the entity is marked as deleted.
Link copied to clipboard
public LifecycleFlags lifecycleFlags()
Obtains current lifecycle flags.
Link copied to clipboard
public boolean lifecycleFlagsChanged()
Tells whether lifecycle flags of the entity changed since its initialization.
Link copied to clipboard
protected EntityClass<? extends Object> modelClass()
Obtains the model class.
Link copied to clipboard
protected void setArchived(boolean archived)
Sets archived status flag to the passed value.
Link copied to clipboard
protected void setDeleted(boolean deleted)
Sets deleted status flag to the passed value.
Link copied to clipboard
public final S state()
Obtains the state of the entity.
Link copied to clipboard
protected EntityClass<? extends Object> thisClass()
Obtains model class for this entity.
Link copied to clipboard
public String toString()
Link copied to clipboard
public Version version()
Obtains the version of the entity.
Link copied to clipboard
protected int versionNumber()
Obtains the version number of the entity.
Link copied to clipboard
public Timestamp whenModified()
Obtains timestamp of the entity version.