public static class Ini.Entry
extends java.lang.Object
implements java.lang.Cloneable
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NEW_LINE_SEPARATOR
The line separator for multiline key values.
|
static java.lang.String |
NEW_LINE_SEPARATOR_REGEX
The line separator for multiline key values, for use with regular expressions.
|
Constructor and Description |
---|
Ini.Entry(Ini.Entry iniEntry)
Create a new instance of
Entry by copy. |
Ini.Entry(java.lang.String value)
Create a new instance of
Entry for a comment. |
Ini.Entry(java.lang.String value,
boolean concat)
Create a new instance of
Entry for a single line or multiline key value. |
Modifier and Type | Method and Description |
---|---|
Ini.Entry |
clone()
Creates and returns a copy of this
Entry object. |
boolean |
equals(java.lang.Object obj)
Compares the specified object with this
Entry for equality. |
java.lang.String |
getValue()
Get the entry value.
|
int |
hashCode()
Returns the hash code value for this
Entry . |
boolean |
isComment()
Indicate if the entry is a comment or not.
|
boolean |
isConcat()
Indicate if the entry is a lines concatenation or not.
|
void |
setValue(java.lang.String value)
Set the entry value.
|
public static final java.lang.String NEW_LINE_SEPARATOR
public static final java.lang.String NEW_LINE_SEPARATOR_REGEX
public Ini.Entry(java.lang.String value)
Entry
for a comment.value
- the comment value.public Ini.Entry(java.lang.String value, boolean concat)
Entry
for a single line or multiline key value.value
- the value.concat
- true
if the entry is a multiline value, false
if single line value.public Ini.Entry(Ini.Entry iniEntry)
Entry
by copy.iniEntry
- the Entry
to copy all fields.public Ini.Entry clone()
Entry
object.clone
in class java.lang.Object
public boolean equals(java.lang.Object obj)
Entry
for equality. Returns true
if the given object
is also an Entry
and the two Entry
represent the same data. More formally, two
Entry
e1 and e2 represent the same data if e1.isComment()==equals(e2.isComment())
,
e1.isConcat()==equals(e2.isConcat())
and e1.getValue().equals(e2.getValue())
.equals
in class java.lang.Object
obj
- the object to be compared for equality with this Entry
.true
if the specified object is equal to this Entry
, otherwise false
.public int hashCode()
Entry
.
The hash code of an Entry
is defined to be the hash code of the concatenation of its fields: two
booleans to indicate if the instance is a comment and if there is line concatenation, and a string to represent the entry
value.
For example, the hash code for an Entry
that is not a comment, use line concatenation and value is "foo" is:
This ensures that e1.equals(e2) implies that e1.hashCode()==e2.hashCode() for any two"falsetruefoo".hashCode()
Entry
e1 and e2, as
required by the general contract of Object.hashCode
.hashCode
in class java.lang.Object
Entry
.public java.lang.String getValue()
public void setValue(java.lang.String value)
value
- the entry value.public boolean isComment()
true
if the entry is a comment, otherwise false
.public boolean isConcat()
true
if the entry is a lines concatenation, otherwise false
.