|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsbrt.shell.text.AbstractMapEntryFormat<K,V>
sbrt.shell.text.ColonMapEntryFormatV1<K,V>
K
- the key type.V
- the value type.public final class ColonMapEntryFormatV1<K,V>
This class is a concrete implementation of MapEntryFormat. The string representation of map entries is:
key: value.
Instances of this class are immutable.
Constructor Summary | |
---|---|
ColonMapEntryFormatV1(SimpleFormat<K> keyFormat,
SimpleFormat<V> valueFormat)
Constructs a new map entry format using the provided key and value formats. |
Method Summary | ||
---|---|---|
|
formatKey(S key)
Returns a formatted string representation of the provided key object. |
|
|
formatValue(T value)
Returns a formatted string representation of the provided value object. |
|
static ColonMapEntryFormatV1<java.lang.String,java.lang.String> |
getBasic()
Returns a ColonMapEntryFormatV1 that does not
format or parse the keys or values supplied to it. |
|
SimpleFormat<K> |
getKeyFormat()
Returns the format used for keys. |
|
SimpleFormat<V> |
getValueFormat()
Returns the format used for values. |
|
K |
parseKey(java.lang.String key)
Parses the provided string representation of a key object. |
|
V |
parseValue(java.lang.String value)
Parses the provided string representation of a value object. |
Methods inherited from class sbrt.shell.text.AbstractMapEntryFormat |
---|
formatPair, formatPair, getDelimiter, getLeftPadding, getRightPadding, parsePair |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ColonMapEntryFormatV1(SimpleFormat<K> keyFormat, SimpleFormat<V> valueFormat)
keyFormat
- the format to use for keys.valueFormat
- the format to use for values.
java.lang.NullPointerException
- if either argument is null
.Method Detail |
---|
public static final ColonMapEntryFormatV1<java.lang.String,java.lang.String> getBasic()
ColonMapEntryFormatV1
that does not
format or parse the keys or values supplied to it. In other
words, it returns a ColonMapEntryFormatV1
with
the most basic possible functionality. Empty strings are not
allowed however.
ColonMapEntryFormatV1
that does not
format or parse the keys and values supplied to it.public SimpleFormat<K> getKeyFormat()
public SimpleFormat<V> getValueFormat()
public <S extends K> java.lang.String formatKey(S key)
S
- a type extending the primary key type.key
- the key object to format.
public <T extends V> java.lang.String formatValue(T value)
T
- a type extending the primary value type.value
- the value object to format.
public K parseKey(java.lang.String key)
key
- the string representation of a
key object.
public V parseValue(java.lang.String value)
value
- the string representation of a
value object.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |