Package io.github.arthurhoch.kissconfig
Record Class ConfigValue
java.lang.Object
java.lang.Record
io.github.arthurhoch.kissconfig.ConfigValue
- Record Components:
canonicalKey- normalized dot-form keyrawKey- original key from the sourcevalue- raw or interpolated string valuesourceName- human-readable source namesourceType- source location typesourcePath- source path when availablelineNumber- source line number when availablesecret- 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 Summary
ConstructorsConstructorDescriptionConfigValue(String canonicalKey, String rawKey, String value, String sourceName, ConfigLocationType sourceType, Path sourcePath, Integer lineNumber, boolean secret) Creates a config value. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecanonicalKeyrecord component.Returns the value masked when secret.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thelineNumberrecord component.Returns the optional line number.Returns the optional source path.rawKey()Returns the value of therawKeyrecord component.booleansecret()Returns the value of thesecretrecord component.Returns the value of thesourceNamerecord component.Returns the value of thesourcePathrecord component.Returns the value of thesourceTyperecord component.final StringtoString()Returns a string representation of this record class.value()Returns the value of thevaluerecord component.withSecret(boolean newSecret) Returns this value with updated secret status.Returns this value with a different string value.
-
Constructor Details
-
Method Details
-
optionalSourcePath
Returns the optional source path.- Returns:
- optional path
-
optionalLineNumber
Returns the optional line number.- Returns:
- optional line number
-
withValue
Returns this value with a different string value.- Parameters:
newValue- replacement value- Returns:
- copied config value
-
withSecret
Returns this value with updated secret status.- Parameters:
newSecret- secret status- Returns:
- copied config value
-
displayValue
Returns the value masked when secret.- Returns:
- safe display value
-
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
canonicalKey
Returns the value of thecanonicalKeyrecord component.- Returns:
- the value of the
canonicalKeyrecord component
-
rawKey
Returns the value of therawKeyrecord component.- Returns:
- the value of the
rawKeyrecord component
-
value
Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-
sourceName
Returns the value of thesourceNamerecord component.- Returns:
- the value of the
sourceNamerecord component
-
sourceType
Returns the value of thesourceTyperecord component.- Returns:
- the value of the
sourceTyperecord component
-
sourcePath
Returns the value of thesourcePathrecord component.- Returns:
- the value of the
sourcePathrecord component
-
lineNumber
Returns the value of thelineNumberrecord component.- Returns:
- the value of the
lineNumberrecord component
-
secret
public boolean secret()Returns the value of thesecretrecord component.- Returns:
- the value of the
secretrecord component
-