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 Link icon

    • STRING_LIST_LENGTH Link icon

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

      public static final String SEPARATOR
      Default separator sign of a string list.
      See Also:
  • Constructor Details Link icon

    • StringListConverter Link icon

      public StringListConverter()
  • Method Details Link icon

    • getListLength Link icon

      protected int getListLength()
      Return the maximum list length.
      Returns:
      The maximum list length
      See Also:
    • getSeparator Link icon

      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 Link icon

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

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