Java HashMap Convert toArrayListHashMapStrObj(Object object)

Here you can find the source of toArrayListHashMapStrObj(Object object)

Description

replacement of casting as from Object to ArrayList<HashMap<String, Object>> without annoying warning.

License

Open Source License

Parameter

Parameter Description
object a parameter

Return

object it self which is casted as return type.

Declaration

@SuppressWarnings("unchecked")
public static ArrayList<HashMap<String, Object>> toArrayListHashMapStrObj(Object object) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.ArrayList;
import java.util.HashMap;

public class Main {
    /**// w w  w .  ja v a  2  s.  co  m
     * replacement of casting as from Object to
     * <tt>ArrayList&lt;HashMap&lt;String, Object&gt;&gt;</tt> without annoying
     * warning.
     * 
     * @param object
     * @return object it self which is casted as return type.
     */
    @SuppressWarnings("unchecked")
    public static ArrayList<HashMap<String, Object>> toArrayListHashMapStrObj(Object object) {
        if (object == null) {
            return null;
        }
        return (ArrayList<HashMap<String, Object>>) object;
    }
}

Related

  1. hashMapToArray(HashMap map)
  2. HashMapToParamsString(HashMap params)
  3. hashMapToString(HashMap map)