Enum Class EntryPresence
- All Implemented Interfaces:
Serializable,Comparable<EntryPresence>,java.lang.constant.Constable
Used with AbstractConfigEntity#saveOperatorMapEntry(EntryPresence, String, String...). An operator command
that creates an entry (/autoreply add <name>) writes under MUST_BE_ABSENT, so it never replaces an
entry of that name the operator added to the file by hand since it was read. A command that changes an existing entry
(/autoreply setkeyword <name>) writes under MUST_BE_PRESENT, so it never writes back an entry the
operator deleted by hand.
The condition is decided on the same read of the file that the configuration write gate verifies the write against. An edit saved after that read is never written over: the gate then refuses the write because the file changed.
What "present" means. The entry is present when its whole key path exists in the file. The path is where the
framework reads the setting (its nested keys, or the flat dotted key the operator wrote), followed by the map keys,
each of them one whole key. An entry holding null (name: ~) is present. An entry is absent when its
key is missing, or when a key above it is missing, null, an empty map ({}) or not a map. A file that
is missing, empty or holds only comments holds no entry.
- Since:
- 6.3.0
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe entry must not be in the file yet; the write creates it and never replaces one the file holds.The entry must already be in the file; the write changes or removes it and never creates it. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic EntryPresenceReturns the enum constant of this class with the specified name.static EntryPresence[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
MUST_BE_PRESENT
The entry must already be in the file; the write changes or removes it and never creates it. -
MUST_BE_ABSENT
The entry must not be in the file yet; the write creates it and never replaces one the file holds.
-
-
Constructor Details
-
EntryPresence
private EntryPresence()
-
-
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
-