Package org.openwms.common.location
Class StringListConverter
java.lang.Object
org.openwms.common.location.StringListConverter
public class StringListConverter
extends Object
implements jakarta.persistence.AttributeConverter<List<String>,String>
A StringListConverter is a JPA
AttributeConverter
that is able to convert a String
into a List
of strings and
vice-versa.- Author:
- Heiko Scherrer
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Default separator sign of a string list.static final int
Default length of the string list. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionconvertToDatabaseColumn
(List<String> attribute) convertToEntityAttribute
(String dbData) protected int
Return the maximum list length.protected String
Return the separator that is used to separate the String into a List of Strings.
-
Field Details
-
STRING_LIST_LENGTH
public static final int STRING_LIST_LENGTHDefault length of the string list.- See Also:
-
SEPARATOR
Default separator sign of a string list.- See Also:
-
-
Constructor Details
-
StringListConverter
public StringListConverter()
-
-
Method Details
-
getListLength
protected int getListLength()Return the maximum list length.- Returns:
- The maximum list length
- See Also:
-
getSeparator
Return the separator that is used to separate the String into a List of Strings.- Returns:
- The separator as String
- See Also:
-
convertToDatabaseColumn
-
convertToEntityAttribute
-