Package com.ultikits.ultitools.config
Class ConfigEntryPresenceException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.io.IOException
com.ultikits.ultitools.config.ConfigWriteRefusedException
com.ultikits.ultitools.config.ConfigEntryPresenceException
- All Implemented Interfaces:
Serializable
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 Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConfigEntryPresenceException(String file, String reason, EntryPresence required) Creates the exception for one write whose condition did not hold. -
Method Summary
Modifier and TypeMethodDescriptionThe condition the write was made under, which did not hold.Methods inherited from class com.ultikits.ultitools.config.ConfigWriteRefusedException
getFile, getReasonMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
required
-
-
Constructor Details
-
ConfigEntryPresenceException
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 operatorreason- why it was not written, as a phrase naming the entry's key path and no valuerequired- the condition the write was made under, which did not hold
-
-
Method Details
-
getRequired
The condition the write was made under, which did not hold.- Returns:
EntryPresence.MUST_BE_ABSENTwhen the entry was already in the file,EntryPresence.MUST_BE_PRESENTwhen it was not
-