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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionentries()Returns the value of theentriesrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static Iniparse(InputStream input) Parse an INI configuration from given inputfinal StringtoString()Returns a string representation of this record class.voidwrite(OutputStream output) Write the text representation of this to given output
-
Constructor Details
-
Ini
Creates an instance of aInirecord class.- Parameters:
entries- the value for theentriesrecord 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 theentriesrecord component.- Returns:
- the value of the
entriesrecord component
-