public static < E > Collection < E > collectify ( ObjectMapper mapper , Object source , Class < ? extends Collection > targetCollectionType , Class < E > targetElementType ) { CollectionType collectionType = mapper . getTypeFactory ( ) . constructCollectionType ( targetCollectionType , targetElementType ) ; return objectify ( mapper , convertToCollection ( source ) , collectionType ) ; }
Convert an object to a collection .