Package org.openhab.io.cv.internal.resources.beans

Examples of org.openhab.io.cv.internal.resources.beans.ItemBean


  @Override
  protected Object getSingleResponseObject(Item item, HttpServletRequest request) {
    ItemStateListBean responseBean ;
    Collection<ItemBean> beans = new LinkedList<ItemBean>();
    beans.add(new ItemBean(item.getName(), item.getState().toString()));
    responseBean = new ItemStateListBean( new ItemListBean(beans));
    responseBean.index = System.currentTimeMillis();
    return responseBean;
  }
View Full Code Here


    }
    return beans;
  }

  public static ItemBean createItemBean(Item item, boolean drillDown) {
    ItemBean bean;
    if (item instanceof GroupItem && drillDown) {
      GroupItem groupItem = (GroupItem) item;
      GroupItemBean groupBean = new GroupItemBean();
      Collection<ItemBean> members = new HashSet<ItemBean>();
      for (Item member : groupItem.getMembers()) {
        members.add(createItemBean(member, false));
      }
      groupBean.members = members.toArray(new ItemBean[members.size()]);
      bean = groupBean;
    } else {
      bean = new ItemBean(item.getName(), item.getState().toString());
    }
    return bean;
  }
View Full Code Here

TOP

Related Classes of org.openhab.io.cv.internal.resources.beans.ItemBean

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.