Class VariableEntity
java.lang.Object
ai.nervemind.app.entity.VariableEntity
Entity for storing workflow variables.
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor for JPA entity instantiation.VariableEntity(String name, String value, ai.nervemind.common.dto.VariableDTO.VariableType type, ai.nervemind.common.dto.VariableDTO.VariableScope scope) Creates a new variable entity with the specified parameters. -
Method Summary
Modifier and TypeMethodDescriptionGets the timestamp when this variable was first created.Gets the description of this variable.Gets the encrypted value of this variable.getId()Gets the unique identifier of this variable.getName()Gets the unique name identifier for this variable.ai.nervemind.common.dto.VariableDTO.VariableScopegetScope()Gets the scope of this variable (global or workflow-specific).ai.nervemind.common.dto.VariableDTO.VariableTypegetType()Gets the data type of this variable.Gets the timestamp when this variable was last updated.getValue()Gets the value of this variable as a string.Gets the workflow ID this variable belongs to.booleanCheck if this variable stores encrypted data.voidsetCreatedAt(Instant createdAt) Sets the creation timestamp of this variable.voidsetDescription(String description) Sets the description of this variable.voidsetEncryptedValue(String encryptedValue) Sets the encrypted value of this variable.voidSets the unique identifier of this variable.voidSets the unique name identifier for this variable.voidsetScope(ai.nervemind.common.dto.VariableDTO.VariableScope scope) Sets the scope of this variable.voidsetType(ai.nervemind.common.dto.VariableDTO.VariableType type) Sets the data type of this variable.voidsetUpdatedAt(Instant updatedAt) Sets the last update timestamp of this variable.voidSets the value of this variable.voidsetWorkflowId(Long workflowId) Sets the workflow ID this variable belongs to.
-
Constructor Details
-
VariableEntity
public VariableEntity()Default constructor for JPA entity instantiation. Required for JPA proxy creation and deserialization. -
VariableEntity
public VariableEntity(String name, String value, ai.nervemind.common.dto.VariableDTO.VariableType type, ai.nervemind.common.dto.VariableDTO.VariableScope scope) Creates a new variable entity with the specified parameters. Timestamps are automatically managed by Hibernate.- Parameters:
name- the unique name of the variablevalue- the string value of the variabletype- the data type of the variablescope- the scope (global/workflow) of the variable
-
-
Method Details
-
getId
Gets the unique identifier of this variable.- Returns:
- the variable ID, or null if not yet persisted
-
setId
Sets the unique identifier of this variable. This method is primarily used by JPA and should not be called directly.- Parameters:
id- the variable ID to set
-
getName
Gets the unique name identifier for this variable.- Returns:
- the variable name
-
setName
Sets the unique name identifier for this variable.- Parameters:
name- the variable name to set
-
getValue
Gets the value of this variable as a string. For SECRET type variables, this returns the plain text value.- Returns:
- the variable value as a string
-
setValue
Sets the value of this variable. For SECRET type variables, the value should be plain text and will be encrypted automatically.- Parameters:
value- the variable value to set as a string
-
getEncryptedValue
Gets the encrypted value of this variable. Only populated for SECRET type variables.- Returns:
- the encrypted value, or null if not a secret variable
-
setEncryptedValue
Sets the encrypted value of this variable. This method is primarily used by the encryption service.- Parameters:
encryptedValue- the encrypted value to set
-
getType
public ai.nervemind.common.dto.VariableDTO.VariableType getType()Gets the data type of this variable.- Returns:
- the variable type
-
setType
public void setType(ai.nervemind.common.dto.VariableDTO.VariableType type) Sets the data type of this variable.- Parameters:
type- the variable type to set
-
getScope
public ai.nervemind.common.dto.VariableDTO.VariableScope getScope()Gets the scope of this variable (global or workflow-specific).- Returns:
- the variable scope
-
setScope
public void setScope(ai.nervemind.common.dto.VariableDTO.VariableScope scope) Sets the scope of this variable.- Parameters:
scope- the variable scope to set
-
getWorkflowId
Gets the workflow ID this variable belongs to. Null for global variables.- Returns:
- the workflow ID, or null for global variables
-
setWorkflowId
Sets the workflow ID this variable belongs to. Set to null for global variables.- Parameters:
workflowId- the workflow ID to set, or null for global variables
-
getDescription
Gets the description of this variable.- Returns:
- the variable description explaining its purpose
-
setDescription
Sets the description of this variable.- Parameters:
description- the variable description explaining its purpose
-
getCreatedAt
Gets the timestamp when this variable was first created.- Returns:
- the creation timestamp
-
setCreatedAt
Sets the creation timestamp of this variable. This method is primarily used by Hibernate and should not be called directly.- Parameters:
createdAt- the creation timestamp to set
-
getUpdatedAt
Gets the timestamp when this variable was last updated.- Returns:
- the last update timestamp
-
setUpdatedAt
Sets the last update timestamp of this variable. This method is primarily used by Hibernate and should not be called directly.- Parameters:
updatedAt- the last update timestamp to set
-
isEncrypted
public boolean isEncrypted()Check if this variable stores encrypted data.- Returns:
- true if this is a SECRET type variable with encrypted data, false otherwise
-