Class Value
java.lang.Object
org.tquadrat.foundation.inifile.internal.Value
- All Implemented Interfaces:
Comparable<Value>
@ClassVersion(sourceVersion="$Id: Value.java 1134 2024-05-20 16:53:16Z tquadrat $")
@API(status=INTERNAL,
since="0.1.0")
public final class Value
extends Object
implements Comparable<Value>
The container for the value of an INI file.
- Author:
- Thomas Thrien (thomas.thrien@tquadrat.org)
- Version:
- $Id: Value.java 1134 2024-05-20 16:53:16Z tquadrat $
- Since:
- 0.1.0
- UML Diagram
-
UML Diagram for "org.tquadrat.foundation.inifile.internal.Value"
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidaddComment(String comment) Adds a comment to the value.static final booleancheckKeyCandidate(String candidate) An implementation ofPredicateto be used withObjects.requireValidArgument(Object,String,Predicate)when checking the keys for new values.intfinal booleanfinal StringgetValue()Returns the current value.final inthashCode()final voidsetComment(String comment) Sets a comment to the group.final voidSets a new value.final StringtoString()
-
Field Details
-
m_Comment
The comment for this value. -
m_Group
-
m_Key
-
m_Value
-
-
Constructor Details
-
Value
-
Value
-
-
Method Details
-
addComment
Adds a comment to the value.- Parameters:
comment- The comment.
-
checkKeyCandidate
@API(status=INTERNAL, since="0.4.4") public static final boolean checkKeyCandidate(String candidate) An implementation of
Predicateto be used withObjects.requireValidArgument(Object,String,Predicate)when checking the keys for new values.The candidate may not begin with a hash symbol ('#') or an opening bracket ('['), and it may not contain newline characters, tab characters or equal signs.
You should avoid hash symbols and opening brackets completely, even inside or at the end of the key, as well as closing brackets (']'), despite they are technically valid.
- Parameters:
candidate- The key to check.- Returns:
trueif the value is a valid key,falseotherwise.- Throws:
NullArgumentException- The candidate isnull.EmptyArgumentException- The candidate is the empty string.BlankArgumentException- The candidate consists of whitespace only.- Since:
- 0.4.4
-
compareTo
- Specified by:
compareToin interfaceComparable<Value>- Since:
- 0.4.2
-
equals
-
getValue
-
hashCode
-
setComment
-
setValue
-
toString
-
