类 StreamUtils


  • public class StreamUtils
    extends Object
    The type Stream utils.
    版本:
    : V1.0
    作者:
    : CLEAR Li
    • 构造器详细资料

      • StreamUtils

        public StreamUtils()
    • 方法详细资料

      • getPojoToVo

        public static <T,​V> List<V> getPojoToVo​(List<T> list,
                                                      Class<V> cls)
        将pojo类转换为vo
        类型参数:
        T - the type parameter
        V - the type parameter
        参数:
        list - 源数据list
        cls - 目标数据class
        返回:
        java.util.List pojo to vo
      • getModifyPojoToVo

        public static <T,​V> List<V> getModifyPojoToVo​(List<T> list,
                                                            Class<V> cls,
                                                            Function<V,​V>... functions)
        将pojo类转换为vo
        类型参数:
        T - the type parameter
        V - the type parameter
        参数:
        list - 源数据list
        cls - 目标数据class
        functions - the functions
        返回:
        java.util.List modify pojo to vo
      • getPojoToVoToResponse

        public static <T,​V> QueryResponseResult<V> getPojoToVoToResponse​(List<T> list,
                                                                               Class<V> cls,
                                                                               long total)
        将pojo类转换为vo
        类型参数:
        T - the type parameter
        V - the type parameter
        参数:
        list - 源数据list
        cls - 目标数据class
        total - the total
        返回:
        java.util.List pojo to vo to response
      • getModifyPojoToVoToResponse

        @SafeVarargs
        public static <T,​V> QueryResponseResult<V> getModifyPojoToVoToResponse​(List<T> list,
                                                                                     Class<V> cls,
                                                                                     long total,
                                                                                     Function<V,​V>... functions)
        将pojo类转换为vo
        类型参数:
        T - the type parameter
        V - the type parameter
        参数:
        list - 源数据list
        cls - 目标数据class
        total - the total
        functions - the functions
        返回:
        java.util.List modify pojo to vo to response
      • modifyConvert

        public static <T,​V> QueryResponseResult<V> modifyConvert​(List<T> list,
                                                                       Class<V> cls,
                                                                       long total,
                                                                       Function<T,​V> function)
        Modify convert query response result.
        类型参数:
        T - the type parameter
        V - the type parameter
        参数:
        list - the list
        cls - the cls
        total - the total
        function - the function
        返回:
        the query response result
      • modifyConvert

        public static <T,​V> List<V> modifyConvert​(List<T> list,
                                                        Class<V> cls,
                                                        Function<T,​V> function)
        将pojo类转换为vo
        类型参数:
        T - the type parameter
        V - the type parameter
        参数:
        list - 源数据list
        cls - 目标数据class
        function - the function
        返回:
        java.util.List list
      • getSimpleResponse

        public static <T> QueryResponseResult<T> getSimpleResponse​(List<T> list,
                                                                   long total)
        封装返回对象
        类型参数:
        T - the type parameter
        参数:
        list - list集合
        total - 总数
        返回:
        com.yinghuo.framework.response.QueryResponseResult simple response
      • simpleConvert

        public static <T,​V> V simpleConvert​(T obj,
                                                  Class<V> cls)
        将pojo类转换为vo
        类型参数:
        T - the type parameter
        V - the type parameter
        参数:
        obj - 源数据
        cls - 目标数据class
        返回:
        java.util.List v
      • getSingleton

        public static <T> QueryResponseResult<T> getSingleton​(T t)
        封装返回对象
        类型参数:
        T - the type parameter
        参数:
        t - 单例对象
        返回:
        com.yinghuo.framework.response.QueryResponseResult singleton
      • getSingleton

        public static <T> QueryResponseResult<T> getSingleton​(T t,
                                                              ResultCode resultCode)
        封装返回对象
        类型参数:
        T - the type parameter
        参数:
        t - 单例对象
        resultCode - the result code
        返回:
        com.yinghuo.framework.response.QueryResponseResult singleton
      • getEmpty

        public static <T> QueryResponseResult<T> getEmpty()
        封装返回对象
        类型参数:
        T - the type parameter
        返回:
        com.yinghuo.framework.response.QueryResponseResult empty
      • getSingleton

        public static <T,​V> QueryResponseResult<V> getSingleton​(T t,
                                                                      Class<V> cls)
        封装返回对象
        类型参数:
        T - the type parameter
        V - the type parameter
        参数:
        t - 单例对象
        cls - the cls
        返回:
        com.yinghuo.framework.response.QueryResponseResult singleton
      • oneConvertModify

        public static void oneConvertModify​(Object source,
                                            String dateFormat,
                                            Object target)
        One convert modify.
        参数:
        source - the source
        dateFormat - the date format
        target - the target