Class AbstractCollectionReflectionTranscoder

    • Field Detail

      • type

        private final Class<?> type
        Type that is a collection.
    • Constructor Detail

      • AbstractCollectionReflectionTranscoder

        public AbstractCollectionReflectionTranscoder​(Class<?> c,
                                                      SingleValueReflectionTranscoder<?> transcoder)
        Creates a new abstract collection reflection transcoder.
        Parameters:
        c - class that is a collection
        transcoder - to operate on elements of the collection
      • AbstractCollectionReflectionTranscoder

        public AbstractCollectionReflectionTranscoder​(Class<?> c,
                                                      ArrayReflectionTranscoder transcoder)
        Creates a new abstract collection reflection transcoder.
        Parameters:
        c - class that is a collection
        transcoder - to operate on elements of the collection
    • Method Detail

      • encodeBinaryValues

        public Collection<byte[]> encodeBinaryValues​(Object values)
        Description copied from interface: ReflectionTranscoder
        Encodes the supplied value into one or more byte arrays for use in an attribute.
        Specified by:
        encodeBinaryValues in interface ReflectionTranscoder
        Parameters:
        values - containing data to encode as byte arrays
        Returns:
        binary attribute values
      • createCollection

        protected abstract <T> Collection<T> createCollection​(Class<T> clazz)
        Returns a collection implementation of the correct type for this transcoder.
        Type Parameters:
        T - type of collection
        Parameters:
        clazz - type of collection
        Returns:
        collection implementation
      • supports

        public boolean supports​(Class<?> t)
        Description copied from interface: ReflectionTranscoder
        Returns whether this transcoder can convert object of the supplied type.
        Specified by:
        supports in interface ReflectionTranscoder
        Parameters:
        t - of object
        Returns:
        whether the supplied type can be converted