Package com.yahoo.config.ini
Record Class Ini
java.lang.Object
java.lang.Record
com.yahoo.config.ini.Ini
- Record Components:
entries
- Entries of the INI file, grouped by section.
Basic INI file parser.
Supported syntax:
- Sections. Surrounded with '[' and ']'
- Optional quoting of values. When quoted, the quote character '"' can be escaped with '\'
- Comments, separate and in-line. Indicated with leading ';' or '#'
Behaviour:
- Leading and trailing whitespace is always ignored if the value is unquoted
- Sections are sorted in alphabetic order. The same goes for keys within a section
- Empty string in the parsed Map holds section-less config keys
- Duplicated keys within the same section is an error
- Parsing discards comments
- No limitations on section or key names
- Author:
- mpolden
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionentries()
Returns the value of theentries
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.static Ini
parse
(InputStream input) Parse an INI configuration from given inputfinal String
toString()
Returns a string representation of this record class.void
write
(OutputStream output) Write the text representation of this to given output
-
Constructor Details
-
Ini
Creates an instance of aIni
record class.- Parameters:
entries
- the value for theentries
record component
-
-
Method Details
-
write
Write the text representation of this to given output -
parse
Parse an INI configuration from given input -
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. All components in this record class are compared withObjects::equals(Object,Object)
. -
entries
Returns the value of theentries
record component.- Returns:
- the value of the
entries
record component
-