public class NameValue extends GenericObject implements Map.Entry<String,String>
Modifier and Type | Field and Description |
---|---|
protected boolean |
isFlagParameter |
protected boolean |
isQuotedString |
AND, AT, COLON, COMMA, DOT, DOUBLE_QUOTE, EQUALS, GREATER_THAN, HT, immutableClasses, indentation, LESS_THAN, LPAREN, matchExpression, NEWLINE, PERCENT, POUND, QUESTION, QUOTE, RETURN, RPAREN, SEMICOLON, SLASH, SP, STAR, stringRepresentation
Constructor and Description |
---|
NameValue() |
NameValue(String n,
Object v)
Original constructor, sets isFlagParameter to 'false'
|
NameValue(String n,
Object v,
boolean isFlag)
New constructor, taking a boolean which is set if the NV pair is a flag
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Clones this object.
|
String |
encode()
Get the encoded representation of this namevalue object.
|
StringBuilder |
encode(StringBuilder buffer)
Put the encoded version of this object in the given StringBuilder.
|
boolean |
equals(Object other)
Equality comparison predicate.
|
String |
getKey() |
String |
getName() |
String |
getValue() |
Object |
getValueAsObject() |
Object |
getValueAsObject(boolean stripQuotes) |
int |
hashCode() |
boolean |
isValueQuoted()
Return true if the value is quoted in doublequotes.
|
void |
setName(String n)
Set the name member
|
void |
setQuotedValue()
A flag that indicates that doublequotes should be put around the value
when encoded (for example name=value when value is doublequoted).
|
void |
setSeparator(String sep)
Set the separator for the encoding method below.
|
String |
setValue(String value) |
void |
setValueAsObject(Object v)
Set the value member
|
dbgPrint, dbgPrint, debugDump, debugDump, getClassFromName, getIndentation, getMatcher, isMySubclass, makeClone, match, merge, setMatcher, sprint, sprint, sprint, sprint, sprint, sprint, sprint, sprint, sprint
protected boolean isQuotedString
protected final boolean isFlagParameter
public NameValue()
public NameValue(String n, Object v, boolean isFlag)
n
- v
- isFlag
- public void setSeparator(String sep)
public void setQuotedValue()
public boolean isValueQuoted()
public String getName()
public Object getValueAsObject()
public Object getValueAsObject(boolean stripQuotes)
public void setName(String n)
public void setValueAsObject(Object v)
public String encode()
encode
in class GenericObject
public StringBuilder encode(StringBuilder buffer)
GenericObject
encode
in class GenericObject
public Object clone()
GenericObject
clone
in class GenericObject
public boolean equals(Object other)
Copyright © 2015. All Rights Reserved.