Class ConfigEvent

java.lang.Object
org.apache.juneau.config.event.ConfigEvent

public class ConfigEvent extends Object
Represents a change to a config.
  • Method Details

    • 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 be null.
      key - The entry name.
      Must not be null.
      value - The entry value.
      Can be null 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 be null.
      Returns:
      A new ConfigEvent object.
    • removeEntry

      public static ConfigEvent removeEntry(String config, String section, String key)
      Removes a value from a configuration.
      Parameters:
      config - The configuration name.
      section - The section name.
      Must not be null.
      key - The entry name.
      Must not be null.
      Returns:
      A new ConfigEvent object.
    • setSection

      public static ConfigEvent setSection(String config, String section, List<String> prelines)
      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 be null.
      Returns:
      A new ConfigEvent object.
    • removeSection

      public static ConfigEvent removeSection(String config, String section)
      Removes a section from the config.
      Parameters:
      config - The configuration name.
      section - The section name.
      Returns:
      A new ConfigEvent object.
    • getType

      Returns the event type.
      Returns:
      The event type.
    • getConfig

      public String getConfig()
      Returns the configuration name.
      Returns:
      The configuration name.
    • getSection

      public String getSection()
      Returns the section name.
      Returns:
      The section name.
    • getKey

      public String getKey()
      Returns the entry name.
      Returns:
      The entry name.
    • getValue

      public String getValue()
      Returns the entry value.
      Returns:
      The entry value.
    • getComment

      public String getComment()
      Returns the entry comment.
      Returns:
      The entry comment.
    • getPreLines

      public List<String> getPreLines()
      Returns the section or entry lines.
      Returns:
      The section or entry lines.
    • getModifiers

      public String getModifiers()
      Returns the modifiers on this entry.
      Returns:
      The modifier characters.
      Never null.
    • toString

      public String toString()
      Overrides:
      toString in class Object