Package net.sf.basedb.util.formatter
Class CollectionFormatter<I>
java.lang.Object
net.sf.basedb.util.formatter.CollectionFormatter<I>
- All Implemented Interfaces:
Formatter<Collection<I>>
Formatter implementation that formats a collection of values to a
string by concatenating the values with a given separator.
Reverse parsing is not supported.
- Since:
- 3.16
- Author:
- nicklas
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCollectionFormatter
(String separator, boolean skipNull, Formatter<? super I> parent) CollectionFormatter
(Formatter<? super I> parent) Create a collection formatting using ", " as separator and skipping null values. -
Method Summary
Modifier and TypeMethodDescriptionformat
(Collection<I> values) Format a value by converting it to a string.parseString
(String value) Parse a string and return a value of the correct type.
-
Field Details
-
parent
-
separator
-
skipNull
private final boolean skipNull
-
-
Constructor Details
-
CollectionFormatter
Create a collection formatting using ", " as separator and skipping null values. -
CollectionFormatter
-
-
Method Details
-
format
Description copied from interface:Formatter
Format a value by converting it to a string. -
parseString
Description copied from interface:Formatter
Parse a string and return a value of the correct type. A null input string should (unless otherwise documented by a specific formatter implementation) be allowed and may return null or any other "default" value.- Specified by:
parseString
in interfaceFormatter<I>
- Parameters:
value
- The string to parse- Returns:
- An object
-