Package de.xima.fc.prompt.mgmt.service
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:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)inthashCode()Longid()Gets the ID of the scope.PromptScopeKindkind()Gets the kind of the scope, e.g.static PromptScopeofProject(Long projectId)Creates a new scope instance for the project scope.static PromptScopeofSystem()Get a scope instance for the system scope.static PromptScopeofTenant(Long tenantId)Creates a new scope instance for the tenant scope.StringtoString()static PromptScopevalueOf(String value)Parses a prompt scope from its string representation, as returned bytoString().
-
-
-
Method Detail
-
id
public Long id()
Gets the ID of the scope. For theSYSTEMscope, this is always0.- 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 bytoString().- 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.
-
-