Class ConfigEntryPresenceException

All Implemented Interfaces:
Serializable

public class ConfigEntryPresenceException extends ConfigWriteRefusedException
Thrown when an operator's map-entry write made under an EntryPresence condition was not written because the condition did not hold: the entry is already in the file under EntryPresence.MUST_BE_ABSENT, or it is no longer in the file under EntryPresence.MUST_BE_PRESENT.

It is a ConfigWriteRefusedException, so a caller that handles refusals already handles it. Nothing was written: the file keeps its bytes and its modification time, and the in-memory value the module set stays as it is. The framework logs nothing above FINE for it, because the condition is the caller's to report. getRequired() tells the caller which condition failed, so it can tell the operator what happened, for example "a rule of that name is already in the file; reload to see it". ConfigWriteRefusedException.getReason() names the entry's key path and never a value.

Since:
6.3.0
See Also:
  • Field Details

  • Constructor Details

    • ConfigEntryPresenceException

      public ConfigEntryPresenceException(String file, String reason, EntryPresence required)
      Creates the exception for one write whose condition did not hold.
      Parameters:
      file - the configuration file that was not written, as it should be named to the operator
      reason - why it was not written, as a phrase naming the entry's key path and no value
      required - the condition the write was made under, which did not hold
  • Method Details