Package fr.olympus.prometheus.entity
Class Entity
java.lang.Object
fr.olympus.prometheus.entity.Entity
- All Implemented Interfaces:
IEntity
Abstract base class for all entities in the system.
Provides common properties and methods for managing entity metadata and state.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected UUIDCurrent UUID of the entity instance.protected String[]Groups that this entity belongs to.protected booleanIndicates whether the entity is alive.protected final StringName of the entity.protected StringUnique identifier for the entity in the registry. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSets the alive status of the entity.String[]Gets the groups that this entity belongs to.getName()Gets the name of the entity.Gets the unique identifier of the entity in the registry.booleanChecks if the entity belongs to a specific group.booleanChecks if the entity belongs to all of the specified groups.booleanisAlive()Checks if the entity is alive.voidsetAlive(boolean alive) Sets the alive status of the entity.voidsetRegistryMeta(String registryId, String[] groups) Sets the registry metadata for the entity.
-
Field Details
-
registryId
Unique identifier for the entity in the registry. -
name
Name of the entity. -
currentUUID
Current UUID of the entity instance. -
isAlive
protected boolean isAliveIndicates whether the entity is alive. -
groups
Groups that this entity belongs to.
-
-
Constructor Details
-
Entity
Constructs a new Entity with the specified name.- Parameters:
name- The name of the entity.- Throws:
IllegalArgumentException- if name is null or blank.
-
-
Method Details
-
getRegistryId
Gets the unique identifier of the entity in the registry.- Specified by:
getRegistryIdin interfaceIEntity- Returns:
- The registry ID of the entity.
-
setRegistryMeta
Sets the registry metadata for the entity.- Specified by:
setRegistryMetain interfaceIEntity- Parameters:
registryId- The unique identifier in the registry.groups- An array of strings representing the groups to which the entity belongs.- Throws:
IllegalArgumentException- if registryId is null or blank.
-
isAlive
public boolean isAlive()Checks if the entity is alive. -
setAlive
public void setAlive(boolean alive) Sets the alive status of the entity. -
currentUUID
Sets the alive status of the entity.- Specified by:
currentUUIDin interfaceIEntity- Returns:
- true if the entity is now alive, false if it is now dead.
-
getName
Gets the name of the entity. -
entityGroup
Gets the groups that this entity belongs to.- Specified by:
entityGroupin interfaceIEntity- Returns:
- An array of group names that this entity belongs to.
-
hasGroup
Checks if the entity belongs to a specific group. -
hasGroups
Checks if the entity belongs to all of the specified groups.
-