|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jminor.common.model.valuemap.StringProvider<K>
K
- the type of the map keyspublic final class StringProvider<K>
Provides String representations of ValueMap objects.
Given a ValueMap named valueMap containing the following mappings:
"key1" -> value1 "key2" -> value2 "key3" -> value3 "key4" -> {ValueMap instance with a single mapping "refKey" -> refValue}
StringProvider provider = new StringProvider();
provider.addText("key1=").addValue("key1").addText(", key3='").addValue("key3")
.addText("' referenced value=").addReferencedValue("key4", "refKey");
System.out.println(provider.toString(valueMap));
key1=value1, key3='value3' referenced value=refValue
Constructor Summary | |
---|---|
StringProvider()
Instantiates a new StringProvider instance |
|
StringProvider(K key)
Instantiates a new StringProvider instance, with the value mapped to the given key |
Method Summary | |
---|---|
StringProvider<K> |
addFormattedValue(K key,
Format format)
Adds the value mapped to the given key to this StringProvider |
StringProvider<K> |
addReferencedValue(K referenceKey,
K key)
Adds the value mapped to the given key in the ValueMap instance mapped to the given foreignKeyPropertyID to this StringProvider |
StringProvider<K> |
addText(String text)
Adds the given static text to this StringProvider |
StringProvider<K> |
addValue(K key)
Adds the value mapped to the given key to this StringProvider |
String |
toString(ValueMap<K,?> valueMap)
Builds a string from the given value map |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StringProvider()
public StringProvider(K key)
key
- the keyMethod Detail |
---|
public String toString(ValueMap<K,?> valueMap)
toString
in interface ValueMap.ToString<K>
valueMap
- the value map
public StringProvider<K> addValue(K key)
key
- the key
public StringProvider<K> addFormattedValue(K key, Format format)
key
- the keyformat
- the Format to use when appending the value
public StringProvider<K> addReferencedValue(K referenceKey, K key)
referenceKey
- the reference keykey
- the key
public StringProvider<K> addText(String text)
text
- the text to add
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |