This page contains an explanation of the advanced topics of the Java INI Package, along with code examples and explanations. Although this document aims to be as concise as possible, developers are recommended to consult the javadoc for a more complete and upto date documentation of Java INI Package.
10. Equality & Compatibility
10.1. Equality
10.2. Compatibility
TODO: write documentation for "10. Equality & Compatibility"
The final topic in this tutorial is Equality & Compatibility. Hopefully, if you've
followed the tutorial in order, you should know that you can change whether an IniFile,
IniSection or an IniItem is case-sensitive or not, as well as what
IniValidator it has. With that in mind, lets begin.
To explain what makes to IniFiles equal, we shall look at what makes
IniItems equal. Two IniItems are said to be equal if:
IniValidators are equal (as defined by IniValidator.equal(Object)
method).IniItmes are case-insensitive then the two names
only need to be equal regardless of the name's case).IniItmes are
case-insensitive then the comments only need to be equal regardless of the comments' case).IniItmes are case-insensitive then the
values only need to be equal regardless of the value's case).IniSections equality has the same first 4 rules as IniItem's, but
also are said to be equal if:
IniItemsIniItem in one of the IniSections are also present in the other
IniSection (as defined by the IniItem.equals(Object) method).IniItems is the same in both IniSectionsFinally, IniFiles equality also has the same first 4 rules as IniItem's, but
also are said to be equal if:
IniSectionsIniSection in one of the IniFiles are also present in the other
IniFile (as defined by the IniSection.equals(Object) method).IniSections is the same in both IniFilesWith IniFiles, IniSections and IniItems having different case
sensitivity and validators, you will inevitably come across compatibility problems. For example,
can you add a case insensitive IniItem called "name" to a case-sensitive.
IniSection which already has an IniItem called "Name"?.
To make the whole situation simpler and to avoid any confusions, IniItems and
IniSections need to be added to IniSections and IniFiles that
they are compatible with. The simple definition on compatibility is that:
IniValidator (as defined by IniValidator.equals(Object)
method