|
||||||||||
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.EqualsMapEntryFormatV1<K,V>
K
- the key type.V
- the value type.public final class EqualsMapEntryFormatV1<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 | |
---|---|
EqualsMapEntryFormatV1(SimpleFormat<K> keyFormat,
SimpleFormat<V> valueFormat)
Constructs a new map 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 EqualsMapEntryFormatV1<java.lang.String,java.lang.String> |
getBasic()
Returns an EqualsMapEntryFormatV1 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 EqualsMapEntryFormatV1(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 EqualsMapEntryFormatV1<java.lang.String,java.lang.String> getBasic()
EqualsMapEntryFormatV1
that does not
format or parse the keys or values supplied to it. In other
words, it returns an EqualsMapEntryFormatV1
with
the most basic possible functionality. Empty strings are not
allowed however.
EqualsMapEntryFormatV1
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 |