Package org.apache.juneau.config.event
Class ConfigEvent
java.lang.Object
org.apache.juneau.config.event.ConfigEvent
Represents a change to a config.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConfigEvent(ConfigEventType type, String config, String section, String key, String value, String modifiers, String comment, List<String> preLines) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionReturns the entry comment.Returns the configuration name.getKey()Returns the entry name.Returns the modifiers on this entry.Returns the section or entry lines.Returns the section name.getType()Returns the event type.getValue()Returns the entry value.static ConfigEventremoveEntry(String config, String section, String key) Removes a value from a configuration.static ConfigEventremoveSection(String config, String section) Removes a section from the config.static ConfigEventsetEntry(String config, String section, String key, String value, String modifiers, String comment, List<String> prelines) Sets or replaces a value in a configuration.static ConfigEventsetSection(String config, String section, List<String> prelines) Adds a new empty section to the config.toString()
-
Constructor Details
-
ConfigEvent
protected ConfigEvent(ConfigEventType type, String config, String section, String key, String value, String modifiers, String comment, List<String> preLines) Constructor.- Parameters:
type- - The event type.config- - The configuration name.section- - The section name.key- - The entry name.value- - The entry value.modifiers- - The entry modifiers.comment- - Optional comment string to add on the same line as the entry.preLines- - Optional comment lines that occur before this entry.
-
-
Method Details
-
removeEntry
Removes a value from a configuration.- Parameters:
config- The configuration name.section- The section name.
Must not benull .key- The entry name.
Must not benull .- Returns:
- A new
ConfigEventobject.
-
removeSection
Removes a section from the config.- Parameters:
config- The configuration name.section- The section name.- Returns:
- A new
ConfigEventobject.
-
setEntry
public static ConfigEvent setEntry(String config, String section, String key, String value, String modifiers, String comment, List<String> prelines) Sets or replaces a value in a configuration.- Parameters:
config- The configuration name.section- The section name.
Must not benull .key- The entry name.
Must not benull .value- The entry value.
Can benull to remove an entry.comment- Optional comment string to add on the same line as the entry.modifiers- Optional entry modifiers.prelines- Comment lines that occur before this entry.
Must not benull .- Returns:
- A new
ConfigEventobject.
-
setSection
Adds a new empty section to the config.- Parameters:
config- The configuration name.section- The section name.prelines- Comment lines that occur before this section.
Must not benull .- Returns:
- A new
ConfigEventobject.
-
getComment
Returns the entry comment.- Returns:
- The entry comment.
-
getConfig
Returns the configuration name.- Returns:
- The configuration name.
-
getKey
Returns the entry name.- Returns:
- The entry name.
-
getModifiers
Returns the modifiers on this entry.- Returns:
- The modifier characters.
Nevernull .
-
getPreLines
Returns the section or entry lines.- Returns:
- The section or entry lines.
-
getSection
Returns the section name.- Returns:
- The section name.
-
getType
Returns the event type.- Returns:
- The event type.
-
getValue
Returns the entry value.- Returns:
- The entry value.
-
toString
-