Interface ConversionHandler

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      <E extends SimpleEntity,​R>
      R
      cachedEntityFromId​(Class<E> entityType, Class<R> resultType, Long id, boolean rawHandler)
      Finds the given entity by id and then converts it to the result type.
      <T> T clone​(T object)
      Clones the given object, copying all properties
      <T> T convert​(Class<T> toType, Object object)
      Converts an object into the given type
      <T> T convertExcluding​(Class<T> toType, Object object, Object... properties)
      Converts an object into the given type, excluding the given properties
      <T> Function<Object,​T> convertingFunction​(Class<T> toType, Object... exclude)
      Returns a function that converts any input object to a given type, excluding the given properties
      <T> com.mysema.commons.lang.CloseableIterator<T> convertIterator​(Class<T> toType, com.mysema.commons.lang.CloseableIterator<?> iterator)
      Converts a closeable iterator, item by item, into the given type
      <T> Iterator<T> convertIterator​(Class<T> toType, Iterator<?> iterator)
      Converts an iterator, item by item, into the given type
      <T> List<T> convertList​(Class<T> toType, Iterable<?> collection)
      Converts a collection of objects into a list the given type
      <T> List<T> convertList​(Class<T> toType, Iterable<?> collection, Map<?,​?> additionalProperties)
      Converts a collection of objects into a list the given type, setting the given additional properties to each element
      <T> List<T> convertList​(Map<Class<?>,​Class<?>> typeMapping, Iterable<?> collection)
      Converts a collection of objects into a list using the given type mapping
      <T> List<T> convertList​(Map<Class<?>,​Class<?>> typeMapping, Iterable<?> collection, Map<?,​?> additionalProperties)
      Converts a collection of objects into a list using the given type mapping, setting the given additional properties to each element
      <K,​V>
      Map<K,​V>
      convertMap​(Class<K> keyType, Class<V> valueType, Map<?,​?> map)
      Converts the given map's keys and values to the given types
      <T> Page<T> convertPage​(Class<T> toType, Iterable<?> collection)
      Converts a page of objects into a list the given type
      <T> Page<T> convertPage​(Map<Class<?>,​Class<?>> typeMapping, Iterable<?> collection)
      Converts a collection of objects into a page using the given type mapping
      <T> Set<T> convertSet​(Class<T> toType, Iterable<?> collection)
      Converts a collection of objects into a set the given type
      <T> Set<T> convertSet​(Class<T> toType, Iterable<?> collection, Map<?,​?> additionalProperties)
      Converts a collection of objects into a set of the given type, setting the given additional properties to each element
      <T> Set<T> convertSet​(Map<Class<?>,​Class<?>> typeMapping, Iterable<?> collection)
      Converts a collection of objects into a set using the given type mapping
      <T> Set<T> convertSet​(Map<Class<?>,​Class<?>> typeMapping, Iterable<?> collection, Map<?,​?> additionalProperties)
      Converts a collection of objects into a set using the given type mapping, setting the given additional properties to each element
      void fill​(Object source, Object destination)
      Fills the destination object with the source properties
      void fillExcluding​(Object source, Object destination, Object... excludedProprties)
      Fills the destination object with the source properties, excluding the given properties
      FormatterImpl getFormatter()
      Returns a new formatter instance
      Date toDate​(IDate date)
      Converts a IDate (probably a DateTime) representing a date in the logged user's time zone to a Date.
      DateTime toDateTime​(Date date)
      Converts a Date to a DateTime using the logged user's time zone.
    • Method Detail

      • cachedEntityFromId

        <E extends SimpleEntity,​R> R cachedEntityFromId​(Class<E> entityType,
                                                              Class<R> resultType,
                                                              Long id,
                                                              boolean rawHandler)
        Finds the given entity by id and then converts it to the result type. The result is cached in the invocation context by entity type and id.
      • clone

        <T> T clone​(T object)
        Clones the given object, copying all properties
      • convert

        <T> T convert​(Class<T> toType,
                      Object object)
        Converts an object into the given type
      • convertExcluding

        <T> T convertExcluding​(Class<T> toType,
                               Object object,
                               Object... properties)
        Converts an object into the given type, excluding the given properties
      • convertingFunction

        <T> Function<Object,​T> convertingFunction​(Class<T> toType,
                                                        Object... exclude)
        Returns a function that converts any input object to a given type, excluding the given properties
      • convertIterator

        <T> com.mysema.commons.lang.CloseableIterator<T> convertIterator​(Class<T> toType,
                                                                         com.mysema.commons.lang.CloseableIterator<?> iterator)
        Converts a closeable iterator, item by item, into the given type
      • convertIterator

        <T> Iterator<T> convertIterator​(Class<T> toType,
                                        Iterator<?> iterator)
        Converts an iterator, item by item, into the given type
      • convertList

        <T> List<T> convertList​(Class<T> toType,
                                Iterable<?> collection)
        Converts a collection of objects into a list the given type
      • convertList

        <T> List<T> convertList​(Class<T> toType,
                                Iterable<?> collection,
                                Map<?,​?> additionalProperties)
        Converts a collection of objects into a list the given type, setting the given additional properties to each element
      • convertList

        <T> List<T> convertList​(Map<Class<?>,​Class<?>> typeMapping,
                                Iterable<?> collection)
        Converts a collection of objects into a list using the given type mapping
      • convertList

        <T> List<T> convertList​(Map<Class<?>,​Class<?>> typeMapping,
                                Iterable<?> collection,
                                Map<?,​?> additionalProperties)
        Converts a collection of objects into a list using the given type mapping, setting the given additional properties to each element
      • convertMap

        <K,​V> Map<K,​V> convertMap​(Class<K> keyType,
                                              Class<V> valueType,
                                              Map<?,​?> map)
        Converts the given map's keys and values to the given types
      • convertPage

        <T> Page<T> convertPage​(Class<T> toType,
                                Iterable<?> collection)
        Converts a page of objects into a list the given type
      • convertPage

        <T> Page<T> convertPage​(Map<Class<?>,​Class<?>> typeMapping,
                                Iterable<?> collection)
        Converts a collection of objects into a page using the given type mapping
      • convertSet

        <T> Set<T> convertSet​(Class<T> toType,
                              Iterable<?> collection)
        Converts a collection of objects into a set the given type
      • convertSet

        <T> Set<T> convertSet​(Class<T> toType,
                              Iterable<?> collection,
                              Map<?,​?> additionalProperties)
        Converts a collection of objects into a set of the given type, setting the given additional properties to each element
      • convertSet

        <T> Set<T> convertSet​(Map<Class<?>,​Class<?>> typeMapping,
                              Iterable<?> collection)
        Converts a collection of objects into a set using the given type mapping
      • convertSet

        <T> Set<T> convertSet​(Map<Class<?>,​Class<?>> typeMapping,
                              Iterable<?> collection,
                              Map<?,​?> additionalProperties)
        Converts a collection of objects into a set using the given type mapping, setting the given additional properties to each element
      • fill

        void fill​(Object source,
                  Object destination)
        Fills the destination object with the source properties
      • fillExcluding

        void fillExcluding​(Object source,
                           Object destination,
                           Object... excludedProprties)
        Fills the destination object with the source properties, excluding the given properties
      • getFormatter

        FormatterImpl getFormatter()
        Returns a new formatter instance
      • toDate

        Date toDate​(IDate date)
        Converts a IDate (probably a DateTime) representing a date in the logged user's time zone to a Date.