Package io.jmix.aichat.entity
Enum Class AiMessageRole
- All Implemented Interfaces:
EnumClass<String>,Serializable,Comparable<AiMessageRole>,Constable
The role of a message in the
AiChatMessage contract: who authored the
conversation turn. An EnumClass over String, so an application entity
declares its attribute as this type while the database column stays a string holding
getId() — the standard Jmix enum-attribute shape, which Studio generates.
Distinct from MessageRole, which is the rendering discriminator of
AiMessageListItem: this one says who wrote the message, that one says how the
message list draws it. AiChat projects this role onto that one.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable AiMessageRoleReturns the role stored under the given id.getId()static AiMessageRoleReturns the enum constant of this class with the specified name.static AiMessageRole[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
USER
A message authored by the end user. -
ASSISTANT
A message authored by the assistant (the model).
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
fromId
Returns the role stored under the given id.- Parameters:
id- the stored id, ornull- Returns:
- the matching role, or
nullif the id isnullor unknown
-
getId
-