Module org.tquadrat.foundation.util
Class ListStringConverter<E>
java.lang.Object
org.tquadrat.foundation.util.stringconverter.ListStringConverter<E>
- Type Parameters:
E- The element type of the list to convert to a String.
- All Implemented Interfaces:
Serializable,StringConverter<List<E>>
@ClassVersion(sourceVersion="$Id: ListStringConverter.java 1080 2024-01-03 11:05:21Z tquadrat $")
@API(status=STABLE,
since="0.3.0")
public class ListStringConverter<E>
extends Object
implements StringConverter<List<E>>
An implementation of
StringConverter
for arbitrary instances of
List
implementations.
The output of
toString(List)
is quite different from that of a
toString()
method from one of the List implementations, and not really meant
for human readers.
- Author:
- Thomas Thrien (thomas.thrien@tquadrat.org)
- Version:
- $Id: ListStringConverter.java 1080 2024-01-03 11:05:21Z tquadrat $
- Since:
- 0.3.0
- See Also:
- UML Diagram
-
UML Diagram for "org.tquadrat.foundation.util.stringconverter.ListStringConverter"
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final StringConverter<E> The instance ofStringConverterthat is used for the elements of the list.The factory for the list that is used byfromString(CharSequence).private static final PatternThe pattern that is used to identify an entry.static final StringThe pattern that is used to identify an entry: "\\{\\{(.*?)\\}\\}".Fields inherited from interface org.tquadrat.foundation.lang.StringConverter
METHOD_NAME_GetSubjectClass, METHOD_NAME_Provider -
Constructor Summary
ConstructorsConstructorDescriptionListStringConverter(StringConverter<E> converter, Supplier<List<E>> factory) Creates a new instance ofListStringConverter. -
Method Summary
-
Field Details
-
PATTERN
The pattern that is used to identify an entry: "\\{\\{(.*?)\\}\\}".- See Also:
-
m_ElementStringConverter
The instance ofStringConverterthat is used for the elements of the list. -
m_Factory
The factory for the list that is used byfromString(CharSequence). -
m_Pattern
The pattern that is used to identify an entry.
-
-
Constructor Details
-
ListStringConverter
Creates a new instance ofListStringConverter.- Parameters:
converter- The instance ofStringConverterthat is used for the elements of the list.factory- The factory for the list that is used byfromString(CharSequence).
-
-
Method Details
-
fromString
- Specified by:
fromStringin interfaceStringConverter<E>- Throws:
IllegalArgumentException
-
toString
- Specified by:
toStringin interfaceStringConverter<E>
-
