Search in sources :

Example 1 with EzyObjectToMap

use of com.tvd12.ezyfoxserver.client.util.EzyObjectToMap in project ezyfox-server-android-client by youngmonkeys.

the class EzyHashMap method toMap.

/*
	 * (non-Javadoc)
	 * @see com.tvd12.ezyfox.entity.EzyRoObject#toMap()
	 */
@Override
public Map toMap() {
    EzyObjectToMap objectToMap = EzyObjectToMap.getInstance();
    Map map = objectToMap.toMap(this);
    return map;
}
Also used : EzyObjectToMap(com.tvd12.ezyfoxserver.client.util.EzyObjectToMap) EzyObjectToMap(com.tvd12.ezyfoxserver.client.util.EzyObjectToMap) Map(java.util.Map) HashMap(java.util.HashMap)

Example 2 with EzyObjectToMap

use of com.tvd12.ezyfoxserver.client.util.EzyObjectToMap in project ezyfox-server-android-client by youngmonkeys.

the class EzyArrayToList method toList.

@SuppressWarnings({ "rawtypes", "unchecked" })
public List toList(EzyArray array) {
    List answer = new ArrayList<>();
    for (int i = 0; i < array.size(); ++i) {
        Object item = array.get(i);
        Object sitem = item;
        if (item != null) {
            EzyObjectToMap objectToMap = EzyObjectToMap.getInstance();
            if (item instanceof EzyObject)
                sitem = objectToMap.toMap((EzyObject) item);
            else if (item instanceof EzyArray)
                sitem = toList((EzyArray) item);
        }
        answer.add(sitem);
    }
    return answer;
}
Also used : ArrayList(java.util.ArrayList) EzyArray(com.tvd12.ezyfoxserver.client.entity.EzyArray) List(java.util.List) ArrayList(java.util.ArrayList) EzyObject(com.tvd12.ezyfoxserver.client.entity.EzyObject) EzyObject(com.tvd12.ezyfoxserver.client.entity.EzyObject)

Aggregations

EzyArray (com.tvd12.ezyfoxserver.client.entity.EzyArray)1 EzyObject (com.tvd12.ezyfoxserver.client.entity.EzyObject)1 EzyObjectToMap (com.tvd12.ezyfoxserver.client.util.EzyObjectToMap)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1