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

xxl.mathematica.map.Values Maven / Gradle / Ivy

package xxl.mathematica.map;

import java.util.List;
import java.util.Map;

/**
 * 获取值
 */
public class Values {
    /**
     * 值的列表
     *
     * @param map
     * @param 
     * @param 
     * @return
     */
    public static  List values(Map map) {
        return io.vavr.collection.List.ofAll(map.values())
                .asJava();
    }

    /**
     * 所有字段的值
     *
     * @param obj
     * @return
     */
    public static List values(Object obj) {
        return Values.values(Association.association(obj, Keys.keys(obj)));
    }

    /**
     * 给定字段的值
     *
     * @param obj
     * @param fields
     * @return
     */
    public static List values(Object obj, List fields) {
        return Values.values(Association.association(obj, fields));
    }

}