Record Class ConfigValue

java.lang.Object
java.lang.Record
io.github.arthurhoch.kissconfig.ConfigValue
Record Components:
canonicalKey - normalized dot-form key
rawKey - original key from the source
value - raw or interpolated string value
sourceName - human-readable source name
sourceType - source location type
sourcePath - source path when available
lineNumber - source line number when available
secret - whether this value should be masked in diagnostics

public record ConfigValue(String canonicalKey, String rawKey, String value, String sourceName, ConfigLocationType sourceType, Path sourcePath, Integer lineNumber, boolean secret) extends Record
One effective or loaded configuration value with source metadata.
  • Constructor Details

  • Method Details

    • optionalSourcePath

      public Optional<Path> optionalSourcePath()
      Returns the optional source path.
      Returns:
      optional path
    • optionalLineNumber

      public Optional<Integer> optionalLineNumber()
      Returns the optional line number.
      Returns:
      optional line number
    • withValue

      public ConfigValue withValue(String newValue)
      Returns this value with a different string value.
      Parameters:
      newValue - replacement value
      Returns:
      copied config value
    • withSecret

      public ConfigValue withSecret(boolean newSecret)
      Returns this value with updated secret status.
      Parameters:
      newSecret - secret status
      Returns:
      copied config value
    • displayValue

      public String displayValue()
      Returns the value masked when secret.
      Returns:
      safe display value
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • canonicalKey

      public String canonicalKey()
      Returns the value of the canonicalKey record component.
      Returns:
      the value of the canonicalKey record component
    • rawKey

      public String rawKey()
      Returns the value of the rawKey record component.
      Returns:
      the value of the rawKey record component
    • value

      public String value()
      Returns the value of the value record component.
      Returns:
      the value of the value record component
    • sourceName

      public String sourceName()
      Returns the value of the sourceName record component.
      Returns:
      the value of the sourceName record component
    • sourceType

      public ConfigLocationType sourceType()
      Returns the value of the sourceType record component.
      Returns:
      the value of the sourceType record component
    • sourcePath

      public Path sourcePath()
      Returns the value of the sourcePath record component.
      Returns:
      the value of the sourcePath record component
    • lineNumber

      public Integer lineNumber()
      Returns the value of the lineNumber record component.
      Returns:
      the value of the lineNumber record component
    • secret

      public boolean secret()
      Returns the value of the secret record component.
      Returns:
      the value of the secret record component