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