Class VariableEntity

java.lang.Object
ai.nervemind.app.entity.VariableEntity

@Entity public class VariableEntity extends Object
Entity for storing workflow variables.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default 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 Type
    Method
    Description
    Gets the timestamp when this variable was first created.
    Gets the description of this variable.
    Gets the encrypted value of this variable.
    Gets the unique identifier of this variable.
    Gets the unique name identifier for this variable.
    ai.nervemind.common.dto.VariableDTO.VariableScope
    Gets the scope of this variable (global or workflow-specific).
    ai.nervemind.common.dto.VariableDTO.VariableType
    Gets the data type of this variable.
    Gets the timestamp when this variable was last updated.
    Gets the value of this variable as a string.
    Gets the workflow ID this variable belongs to.
    boolean
    Check if this variable stores encrypted data.
    void
    setCreatedAt(Instant createdAt)
    Sets the creation timestamp of this variable.
    void
    setDescription(String description)
    Sets the description of this variable.
    void
    setEncryptedValue(String encryptedValue)
    Sets the encrypted value of this variable.
    void
    setId(Long id)
    Sets the unique identifier of this variable.
    void
    Sets the unique name identifier for this variable.
    void
    setScope(ai.nervemind.common.dto.VariableDTO.VariableScope scope)
    Sets the scope of this variable.
    void
    setType(ai.nervemind.common.dto.VariableDTO.VariableType type)
    Sets the data type of this variable.
    void
    setUpdatedAt(Instant updatedAt)
    Sets the last update timestamp of this variable.
    void
    Sets the value of this variable.
    void
    setWorkflowId(Long workflowId)
    Sets the workflow ID this variable belongs to.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 variable
      value - the string value of the variable
      type - the data type of the variable
      scope - the scope (global/workflow) of the variable
  • Method Details

    • getId

      public Long getId()
      Gets the unique identifier of this variable.
      Returns:
      the variable ID, or null if not yet persisted
    • setId

      public void setId(Long id)
      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

      public String getName()
      Gets the unique name identifier for this variable.
      Returns:
      the variable name
    • setName

      public void setName(String name)
      Sets the unique name identifier for this variable.
      Parameters:
      name - the variable name to set
    • getValue

      public String 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

      public void setValue(String value)
      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

      public 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

      public void setEncryptedValue(String encryptedValue)
      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

      public Long getWorkflowId()
      Gets the workflow ID this variable belongs to. Null for global variables.
      Returns:
      the workflow ID, or null for global variables
    • setWorkflowId

      public void setWorkflowId(Long workflowId)
      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

      public String getDescription()
      Gets the description of this variable.
      Returns:
      the variable description explaining its purpose
    • setDescription

      public void setDescription(String description)
      Sets the description of this variable.
      Parameters:
      description - the variable description explaining its purpose
    • getCreatedAt

      public Instant getCreatedAt()
      Gets the timestamp when this variable was first created.
      Returns:
      the creation timestamp
    • setCreatedAt

      public void setCreatedAt(Instant createdAt)
      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

      public Instant getUpdatedAt()
      Gets the timestamp when this variable was last updated.
      Returns:
      the last update timestamp
    • setUpdatedAt

      public void setUpdatedAt(Instant updatedAt)
      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