All Downloads are FREE. Search and download functionalities are using the official Maven repository.

info.hexin.json.transform.impl.ArrayTransform Maven / Gradle / Ivy

The newest version!
package info.hexin.json.transform.impl;

import info.hexin.json.JsonConfig;
import info.hexin.json.transform.JsonTransform;

import java.util.List;

public class ArrayTransform implements JsonTransform {

    public static final JsonTransform instance = new ArrayTransform();

    @SuppressWarnings("unchecked")
    @Override
    public Object transform(Object value, Class clazz, JsonConfig config) {
        List lists = (List) value;
        return lists.toArray();
    }
}