Package adams.core.base
Class BaseKeyValuePair
- java.lang.Object
-
- adams.core.base.BaseObject
-
- adams.core.base.AbstractBaseString
-
- adams.core.base.BaseKeyValuePair
-
- All Implemented Interfaces:
CloneHandler<BaseObject>,Serializable,Comparable
public class BaseKeyValuePair extends AbstractBaseString
Wrapper for a key/value pairs.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringSEPARATORthe separator.-
Fields inherited from class adams.core.base.BaseObject
m_Internal, m_Properties, SUFFIX_DISPLAY, SUFFIX_VALUE
-
-
Constructor Summary
Constructors Constructor Description BaseKeyValuePair()Initializes the string with length 0.BaseKeyValuePair(String s)Initializes the object with the string to parse.BaseKeyValuePair(String key, String value)Initializes the object with the key/value pair.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static BaseKeyValuePair[]fromMap(Map<String,String> map)Turns the string map into pairs.StringgetPairKey()Returns the key.StringgetPairValue()Returns the value.StringgetTipText()Returns a tool tip for the GUI editor (ignored if null is returned).booleanisValid(String value)Checks whether the string value is a valid presentation for this class.StringpairValue()Returns the backquoted String pair.static Map<String,String>toMap(BaseKeyValuePair[] pairs)Turns the array into a string map.-
Methods inherited from class adams.core.base.AbstractBaseString
convert, getValue, initialize, isEmpty, length, setValue, stringValue
-
Methods inherited from class adams.core.base.BaseObject
compareTo, equals, getClone, getInternal, getTemplates, getUnicode, hasFavoritesSupport, hashCode, isValidUnicode, newInstance, setUnicode, toObjectArray, toObjectArray, toString, toStringArray, toStringList
-
-
-
-
Field Detail
-
SEPARATOR
public static final String SEPARATOR
the separator.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BaseKeyValuePair
public BaseKeyValuePair()
Initializes the string with length 0.
-
BaseKeyValuePair
public BaseKeyValuePair(String key, String value)
Initializes the object with the key/value pair.- Parameters:
key- the key to usevalue- the value to use
-
BaseKeyValuePair
public BaseKeyValuePair(String s)
Initializes the object with the string to parse.- Parameters:
s- the string to parse
-
-
Method Detail
-
isValid
public boolean isValid(String value)
Checks whether the string value is a valid presentation for this class.- Overrides:
isValidin classAbstractBaseString- Parameters:
value- the string value to check- Returns:
- true if non-null
-
getTipText
public String getTipText()
Returns a tool tip for the GUI editor (ignored if null is returned).- Specified by:
getTipTextin classAbstractBaseString- Returns:
- the tool tip
-
pairValue
public String pairValue()
Returns the backquoted String pair.- Returns:
- the backquoted pair
-
getPairKey
public String getPairKey()
Returns the key.- Returns:
- the key
-
getPairValue
public String getPairValue()
Returns the value.- Returns:
- the value
-
toMap
public static Map<String,String> toMap(BaseKeyValuePair[] pairs)
Turns the array into a string map.- Parameters:
pairs- the key/value pairs to use- Returns:
- the generated map
-
fromMap
public static BaseKeyValuePair[] fromMap(Map<String,String> map)
Turns the string map into pairs.- Parameters:
map- the map- Returns:
- the generated pairs
-
-