Class 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:
    Serialized Form
    • Method Detail

      • 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.
      • 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.