Class AbstractListConverter<T>

java.lang.Object
com.broadleafcommerce.common.jpa.converter.AbstractListConverter<T>
Type Parameters:
T - The type of list to be transformed
All Implemented Interfaces:
jakarta.persistence.AttributeConverter<List<T>,String>
Direct Known Subclasses:
CurrencyListConverter, LocaleListConverter, StringListConverter

public abstract class AbstractListConverter<T> extends Object implements jakarta.persistence.AttributeConverter<List<T>,String>
Transforms a list of AbstractListConverter into a JSON object String and vice-versa.
  • Constructor Details

    • AbstractListConverter

      public AbstractListConverter(Class<?> elementType, @Nullable com.fasterxml.jackson.databind.ObjectMapper objectMapper)
    • AbstractListConverter

      public AbstractListConverter(Class<?> elementType, @Nullable com.fasterxml.jackson.databind.ObjectMapper objectMapper, boolean initIfNull)
  • Method Details

    • convertToDatabaseColumn

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

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

      public com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()