Class CollectionConverter


  • public class CollectionConverter
    extends java.lang.Object
    Transforms a Collection from and to a String to be persisted/serialized to the database.
    The Collection may only contain elements of a type that is supported by the ConverterService.
    The conversion follows the following pattern:
    Collection <-> SerializedCollection <-> JSON String. The SerializedCollection is the Java representation of the JSON object.
    The elements in the Collection are converted to Strings using the ConverterService.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean canConvert​(java.lang.Class<?> type)  
      java.lang.String toStringRepresentation​(java.util.Collection<?> collection)  
      java.util.Collection<?> toValue​(java.lang.Class<java.util.Collection<?>> type, java.lang.String string)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • toStringRepresentation

        public java.lang.String toStringRepresentation​(java.util.Collection<?> collection)
      • toValue

        public java.util.Collection<?> toValue​(java.lang.Class<java.util.Collection<?>> type,
                                               java.lang.String string)
      • canConvert

        public boolean canConvert​(java.lang.Class<?> type)