Class StringListConverter

java.lang.Object
org.openwms.common.location.StringListConverter
All Implemented Interfaces:
jakarta.persistence.AttributeConverter<List<String>,String>

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 Details

    • STRING_LIST_LENGTH

      public static final int STRING_LIST_LENGTH
      Default length of the string list.
      See Also:
    • SEPARATOR

      public static final String 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

      protected String getSeparator()
      Return the separator that is used to separate the String into a List of Strings.
      Returns:
      The separator as String
      See Also:
    • convertToDatabaseColumn

      public String convertToDatabaseColumn(List<String> attribute)
      Specified by:
      convertToDatabaseColumn in interface jakarta.persistence.AttributeConverter<List<String>,String>
    • convertToEntityAttribute

      public List<String> convertToEntityAttribute(String dbData)
      Specified by:
      convertToEntityAttribute in interface jakarta.persistence.AttributeConverter<List<String>,String>