Class PromptScope

java.lang.Object
de.xima.fc.prompt.mgmt.service.PromptScope
All Implemented Interfaces:
Serializable

public final class PromptScope extends Object implements Serializable
The scope to which a prompt object can be assigned, consisting of the kind of scope and its ID within that kind.
Since:
8.5.0
See Also:
  • Method Details

    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • id

      public Long id()
      Gets the ID of the scope. For the SYSTEM scope, this is always 0.
      Returns:
      The scope ID.
    • kind

      public PromptScopeKind kind()
      Gets the kind of the scope, e.g. SYSTEM or TENANT.
      Returns:
      The scope kind.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • ofTenant

      public static PromptScope ofTenant(Long tenantId)
      Creates a new scope instance for the tenant scope.
      Parameters:
      tenantId - The ID of the tenant scope.
      Returns:
      The prompt scope.
    • ofProject

      public static PromptScope ofProject(Long projectId)
      Creates a new scope instance for the project scope.
      Parameters:
      projectId - The ID of the project scope.
      Returns:
      The prompt scope.
    • ofSystem

      public static PromptScope ofSystem()
      Get a scope instance for the system scope.
      Returns:
      The prompt scope.
    • valueOf

      public static PromptScope valueOf(String value)
      Parses a prompt scope from its string representation, as returned by toString().
      Parameters:
      value - The string representation.
      Returns:
      The parsed prompt scope, or null when the input is null or blank.
      Throws:
      IllegalArgumentException - When the input string is malformed.