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

com.terapico.caf.wxappviewcomponent.WxappListOf Maven / Gradle / Ivy

The newest version!
package com.terapico.caf.wxappviewcomponent;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.terapico.utils.MapUtil;

public class WxappListOf extends BaseWxappViewComponent{
	protected String displayMode;
	protected List> list;
	protected Map dataContainer;
	
	public String getDisplayMode() {
		return displayMode;
	}

	public void setDisplayMode(String displayMode) {
		this.displayMode = displayMode;
	}

	public List> getList() {
		return list;
	}

	public void setList(List> list) {
		this.list = list;
	}

	public Map getDataContainer() {
		return dataContainer;
	}

	public void setDataContainer(Map dataContainer) {
		this.dataContainer = dataContainer;
	}

	public WxappListOf withDisplayMode(String dmode) {
		this.setDisplayMode(dmode);
		return this;
	}
	public WxappListOf item(Map itemValue) {
		ensureList();
		String id = (String) itemValue.get("id");
		list.add(MapUtil.put("id", id).into_map());
		dataContainer.put(id, itemValue);
		return this;
	}
	private void ensureList() {
		if (list != null) {
			return;
		}
		dataContainer = new HashMap<>();
		list = new ArrayList<>();
	}

	@Override
	protected void mapFieldsToMap(Map resultMap) {
		putInMap(resultMap, "displayMode", getDisplayMode());
		putInMap(resultMap, "list", getList());
		putInMap(resultMap, "dataContainer", getDataContainer());
	}

	@Override
	public String getType() {
		return "listof";
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy