Enum LabelExtensionVisibilityKey
- java.lang.Object
-
- java.lang.Enum<LabelExtensionVisibilityKey>
-
- com.composum.ai.composum.bundle.model.LabelExtensionVisibilityKey
-
- All Implemented Interfaces:
Serializable
,Comparable<LabelExtensionVisibilityKey>
public enum LabelExtensionVisibilityKey extends Enum<LabelExtensionVisibilityKey>
Possible values for theLabelExtensionModel.ATTRIBUTE_AIVISIBLE
. To be flexible to allow only some assistants, we allow a comma separated list of values there and the first matching value tells the visibility. E.g. !create,all says all but create, translate,none says only translate. If nothing matches, the default is taken - currently true.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ALL
The ai is visible.CATEGORIZE
Matches the categorize dialogCREATE
Matches the creation dialog.NONE
The ai is not visible.TRANSLATE
Matches the translation assistant.
-
Field Summary
Fields Modifier and Type Field Description static Pattern
VALID_EXPRESSIONS
A regex that matches all correct visibility declarations: a comma separated list (spaces permitted) of true, false, a name of one of the dialog constants or ! and the name of one of the dialog constants, case-insensitive.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Boolean
isVisible(String value, LabelExtensionVisibilityKey assistant)
Checks whether the item is visible; returns null if the rule doesn't say whether it is.static LabelExtensionVisibilityKey
valueOf(String name)
Returns the enum constant of this type with the specified name.static LabelExtensionVisibilityKey[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
NONE
public static final LabelExtensionVisibilityKey NONE
The ai is not visible.
-
ALL
public static final LabelExtensionVisibilityKey ALL
The ai is visible.
-
TRANSLATE
public static final LabelExtensionVisibilityKey TRANSLATE
Matches the translation assistant.
-
CREATE
public static final LabelExtensionVisibilityKey CREATE
Matches the creation dialog.
-
CATEGORIZE
public static final LabelExtensionVisibilityKey CATEGORIZE
Matches the categorize dialog
-
-
Field Detail
-
VALID_EXPRESSIONS
public static final Pattern VALID_EXPRESSIONS
A regex that matches all correct visibility declarations: a comma separated list (spaces permitted) of true, false, a name of one of the dialog constants or ! and the name of one of the dialog constants, case-insensitive.
-
-
Method Detail
-
values
public static LabelExtensionVisibilityKey[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (LabelExtensionVisibilityKey c : LabelExtensionVisibilityKey.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static LabelExtensionVisibilityKey valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException
- if the argument is null
-
isVisible
public static Boolean isVisible(@Nullable String value, @Nullable LabelExtensionVisibilityKey assistant)
Checks whether the item is visible; returns null if the rule doesn't say whether it is.
-
-