public class IdentifiableFormatter extends java.lang.Object implements Formatter<Identifiable>
Identifiable
items. The formatter
returns the ID of the item. This formatter can not parse strings.Modifier and Type | Field and Description |
---|---|
private java.lang.String |
nullValue |
Constructor and Description |
---|
IdentifiableFormatter()
Create a new formatter.
|
IdentifiableFormatter(java.lang.String nullValue)
Create a new formatter.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
format(Identifiable value)
Format a value by converting it to a string.
|
Identifiable |
parseString(java.lang.String value)
Parse a string and return a value of the correct type.
|
public IdentifiableFormatter()
public IdentifiableFormatter(java.lang.String nullValue)
nullValue
- The string to return if a null item is
passed to format(Identifiable)
public java.lang.String format(Identifiable value)
Formatter
format
in interface Formatter<Identifiable>
value
- The value to formatpublic Identifiable parseString(java.lang.String value)
Formatter
parseString
in interface Formatter<Identifiable>
value
- The string to parsejava.lang.UnsupportedOperationException
- Always