org.modelmapper.jackson.ArrayNodeToCollectionConverter Maven / Gradle / Ivy
package org.modelmapper.jackson;
import com.fasterxml.jackson.databind.node.ArrayNode;
import java.util.Collection;
import org.modelmapper.internal.util.MappingContextHelper;
import org.modelmapper.spi.ConditionalConverter;
import org.modelmapper.spi.MappingContext;
/**
* Converts {@link ArrayNode} instances to {@link Collection} instances.
*
* @author Chun Han Hsiao
*/
public class ArrayNodeToCollectionConverter implements ConditionalConverter> {
@Override
public MatchResult match(Class> sourceType, Class> destinationType) {
return Collection.class.isAssignableFrom(destinationType) && sourceType.isAssignableFrom(ArrayNode.class)
? MatchResult.FULL : MatchResult.NONE;
}
@Override
public Collection